# Jarboot â¤ï¸
![logo](https://gitee.com/majz0908/jarboot/raw/develop/doc/jarboot.png)
[![CodeQL](https://github.com/majianzheng/jarboot/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/majianzheng/jarboot/actions/workflows/codeql-analysis.yml)
![Maven Central](https://img.shields.io/maven-central/v/io.github.majianzheng/jarboot-all)
[![Build Status](https://travis-ci.com/majianzheng/jarboot.svg?branch=master)](https://travis-ci.com/majianzheng/jarboot)
[![codecov](https://codecov.io/gh/majianzheng/jarboot/branch/master/graph/badge.svg?token=FP7EPSFH4E)](https://codecov.io/gh/majianzheng/jarboot)
![GitHub](https://img.shields.io/github/license/majianzheng/jarboot)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/majianzheng/jarboot.svg)](http://isitmaintained.com/project/majianzheng/jarboot "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/majianzheng/jarboot.svg)](http://isitmaintained.com/project/majianzheng/jarboot "Percentage of issues still open")
[![è¯é](https://img.shields.io/badge/%E8%AF%AD%E9%9B%80-%E6%96%87%E6%A1%A3%E7%A4%BE%E5%8C%BA-brightgreen.svg)](https://www.yuque.com/jarboot/usage/quick-start)
![Docker Pulls](https://img.shields.io/docker/pulls/mazheng0908/jarboot)
<code>Jarboot</code> is a platform for Java process startup, shutdown, management and diagnosis. It can manage, guard, monitor and diagnose local and remote Java processes.
In the test environment and daily built integrated environment, a series of jar files such as compilation output can be put into the agreed directory. <code>Jarboot</code> provides a friendly browser UI interface and HTTP interface to manage its start, stop and status monitoring, and execute commands to debug the target process.
[ä¸æ说æ/Chinese Documentation](README_CN.md)
ð Document: https://www.yuque.com/jarboot
ð Best practices ð¥ : [Jarboot with Spring Cloud Alibaba Example](https://github.com/majianzheng/jarboot-with-spring-cloud-alibaba-example) âï¸
ð³ Extensible: Support both <code>JDK SPI</code> and <code>Spring SPI</code>, support plugins develop.
![overview](https://gitee.com/majz0908/jarboot/raw/develop/doc/overview.png)
## Background and objectives
<code>Jarboot</code> uses Java agent and <code>ASM</code> technology to inject code into the target java process,
which is non-invasive. The injected code is only used for command interaction with jarboot's service. Some commands
modify the bytecode of the class for class enhancement. A command system similar to <code>Arthas</code> is added, such
as acquiring JVM information, monitoring thread status, acquiring thread stack information, etc.
- ð Browser interface management, one click start, stop, do not have to manually execute one by one.
- ð¥ Support start and stop priority configuration<sup id="a2">[[1]](#f1)</sup>, and default parallel start.
- â Process daemon. If the service exits abnormally after opening, it will be automatically started and notified.
- âï¸ Support file update monitoring, and restart automatically if jar file is updated after opening.<sup id="a3">[[2]](#f2)</sup>
- ð Debug command execution, remote debugging multiple Java processes at the same time, the interface is more friendly.
- ð Support user-define command by <code>SPI</code>, support develop plugins.
![online diagnose](https://gitee.com/majz0908/jarboot/raw/develop/doc/online-diagnose.png)
### Architecture brief introduction
Detailed architecture design [view](jarboot-server/README.md)
Front-end interface adopts <code>React</code> technology, scaffold uses <code>UmiJs</code>, component library uses
<code>UmiJs</code> built-in <code>antd</code>. The back-end service is mainly implemented by <code>SpringBoot</code>, which provides HTTP interface and static resource broker. The process information is pushed through <code>websocket</code> to the front-end interface in real time, and a long connection is maintained with the started java process to monitor its status.
## Install or build
### Download the zip package to install or using docker.
- <a href="https://github.com/majianzheng/jarboot/releases" target="_blank">Download from Github</a>
- ð³ Docker Hub: <https://registry.hub.docker.com/r/mazheng0908/jarboot>
Use <code>docker</code>
```bash
sudo docker run -itd --name jarboot -p 9899:9899 mazheng0908/jarboot
```
### Code build method
Ignore this when using zip package or <code>docker</code>.
Build the jarboot code.
```bash
#At first build ui
$ cd jarboot-ui2
#First time, execute yarn or npm install
$ yarn
#execute compile, yarn build or npm run build, execute yarn start or npm run start at development mode.
$ yarn build
#Switch to the code root directory and compile the Java code
$ cd ../
$ mvn clean install -P prod
```
### Start <code>jarboot</code> server
Ignore this when using <code>docker</code>.
```bash
#Execute startup.sh to start, use startup.cmd when in windows OS.
$ sh startup.sh
```
### Browser access <http://127.0.0.1:9899>
Enter the login page. Initial username: <code>jarboot</code>, default password: <code>jarboot</code>
## SPI Extension, support both JDK and Spring SPI
Use SPI extension can implement your own command, define a command how to execute. Andï¼also can notify stated event to Jarboot server
, don't need to wait no console time.
### SpringBoot Application
1. Import <code>spring-boot-starter-jarboot</code> dependency
```xml
<dependency>
<groupId>io.github.majianzheng</groupId>
<artifactId>spring-boot-starter-jarboot</artifactId>
<version>${jarboot.version}</version>
</dependency>
```
2. Implement <code>CommandProcessor</code>SPI interface
Also, you can use <code>@Bean</code> in the method.<br>
It will use bean name as the command name if not annotated by <code>@Name</code>.
```java
@Name("spring.command.name")
@Summary("The command summary")
@Description("The command usage detail")
@Component
public class DemoServiceImpl implements DemoService, CommandProcessor {
@Override
public String process(CommandSession session, String[] args) {
return "Spring boot Demo user-defined command using Spring SPI";
}
//implement other method...
}
```
It will add two new spring debug command <code>spring.bean</code> and <code>spring.env</code> after imported
<code>spring-boot-starter-jarboot</code> dependence.
```shell
#spring.bean usage:
$ spring.bean [-b <name>] [-d]
#Examples:
# Get all bean names
$ spring.bean
# Get bean info
$ spring.bean -b beanName
# Get bean detail definition
$ spring.bean -b beanName -d
#sping.env usage:
$ spring.env <name>
#Examples:
$ spring.env spring.application.name
```
### None SpringBoot Application
Demonstrate how to use ordinary non springboot applications.
#### How to create user-defined command
1. Import jarboot api dependency
```xml
<dependency>
<groupId>io.github.majianzheng</groupId>
<artifactId>jarboot-api</artifactId>
<scope>provided</scope>
<version>${jarboot.version}</version>
</dependency>
```
2. Implement spi interface
```java
/**
* Use Name to define the command name
*/
@Name("demo")
@Summary("The command summary")
@Description("The command usage detail")
public class DemoCommandProcessor implements CommandProcessor {
@Override
public String process(CommandSession session, String[] args) {
return "demo SPI command result.";
}
}
```
3. Create spi define file
Then create a file in <code>resources</code>/<code>META-INF</code>/<code>services</code> named
<code>com.mz.jarboot.api.cmd.spi.CommandProcessor</code> the content is class full name.
#### Proactive notification of startup completion
```java
public class DemoApplication {
public static void main(String[] args) {
// do something
try {
//Notify completion
JarbootFactory.createAgentService().setStarted();
} catch (Exception e) {
log(e.getMessage
没有合适的资源?快使用搜索试试~ 我知道了~
Jarboot 是一个强大的Java进程管理、诊断的平台.rar
共719个文件
java:452个
ts:77个
tsx:46个
需积分: 5 0 下载量 26 浏览量
2023-08-04
21:07:46
上传
评论
收藏 3.28MB RAR 举报
温馨提示
在测试环境、每日构建的集成环境,可以把一系列编译输出等jar文件放入约定的目录,由Jarboot提供友好的浏览器ui界面和http接口,统一管理它的启动、停止及状态的监控,以及执行命令对目标进程进行调试。 通常情况下,启动一个Java进程往往是使用java -jar xxxx.jar命令,其中xxxx.jar是启动的jar文件。如果需要增加VM参数的话就需要在java后面添加相应的VM参数,如果需要传入参数的话,还需要在命令的最后面添加传入的参数。当然直接使用java -jar太麻烦了,很多人会写一个shell脚本(Linux)或批处理脚本(Windows)。 编写脚本的时候往往是每个人每个项目都有着不同的风格,有些VM的配置在不同的java项目中是完全相同的,却要反复的复制粘贴。项目的启动脚本往往会拷贝一个项目的然后改改,重复的造轮子。 使用Jarboot可以在浏览器界面上启动、停止Java进程,可以方便的在界面上定制启动的参数。可以在浏览器界面上实时观察进程的日志打印和控制台输出,支持进程的守护,进程存活的监控,异常退出后的后置处理器定义等功能。
资源推荐
资源详情
资源评论
收起资源包目录
Jarboot 是一个强大的Java进程管理、诊断的平台.rar (719个子文件)
.eslintrc.cjs 518B
jt.cmd 1KB
startup.cmd 890B
shutdown.cmd 343B
com.mz.jarboot.api.cmd.spi.CommandProcessor 236B
com.mz.jarboot.api.cmd.spi.CommandProcessor 87B
cluster.conf 212B
iconfont.css 2KB
Dockerfile 612B
.editorconfig 245B
.eslintignore 56B
spring.factories 207B
spring.factories 87B
.gitignore 414B
.gitignore 395B
.gitignore 341B
.gitignore 281B
.gitignore 101B
.gitkeep 0B
index.html 1KB
index.html 330B
favicon.ico 66KB
favicon.ico 66KB
ConcurrentWeakKeyHashMap.java 49KB
StringUtils.java 30KB
ObjectView.java 26KB
ClassLoaderCommand.java 22KB
AgentManager.java 22KB
Utils.java 21KB
ServiceManagerImpl.java 19KB
ObjectUtils.java 19KB
ThreadUtil.java 19KB
TimeTunnelCommand.java 19KB
ClassEnhancer.java 19KB
StringUtilsTest.java 17KB
ClientProxy.java 16KB
SettingUtils.java 15KB
Jarboot.java 13KB
NetworkUtils.java 13KB
TaskWatchServiceImpl.java 13KB
DashboardCommand.java 12KB
SettingServiceImpl.java 12KB
DemoServerApplication.java 12KB
ViewRenderUtil.java 11KB
WsClientFactory.java 11KB
JarbootBootstrap.java 11KB
UserServiceImpl.java 11KB
TaskUtils.java 11KB
PropertyFileUtils.java 11KB
TableLineRenderer.java 11KB
CommandExecutor.java 10KB
VirtualScreen.java 10KB
ClassUtils.java 10KB
Style.java 10KB
ObjectViewTest.java 10KB
ThreadLocalRandom.java 10KB
CommandCliParser.java 9KB
RenderUtil.java 9KB
StdOutStreamReactor.java 9KB
OSUtils.java 8KB
ThreadCommand.java 8KB
CommandBuilder.java 8KB
Layout.java 8KB
ServiceManagerClient.java 8KB
JadCommand.java 8KB
CloudController.java 8KB
AnsiLog.java 8KB
UIBuilder.java 8KB
JarbootAgent.java 8KB
AdviceListenerManager.java 8KB
TaskRunCache.java 7KB
MessageUtils.java 7KB
EnvironmentContext.java 7KB
TraceView.java 7KB
SpyImpl.java 7KB
TimeTunnelTable.java 7KB
LangRenderUtil.java 7KB
JvmCommand.java 7KB
SearchMethodCommand.java 7KB
TypeRenderUtils.java 7KB
ClassLoaderView.java 6KB
WatchCommand.java 6KB
CatCommandProcessor.java 6KB
LineRenderer.java 6KB
ZipUtils.java 6KB
AuthController.java 6KB
EnhancerCommand.java 6KB
DumpClassCommand.java 6KB
RenderPrintWriter.java 6KB
JarbootClientCli.java 6KB
AgentClientController.java 6KB
TraceCommand.java 6KB
SearchClassCommand.java 6KB
RowLineRenderer.java 6KB
ServiceSetting.java 6KB
JvmModel.java 6KB
VMUtils.java 6KB
UserController.java 6KB
RoleServiceImpl.java 6KB
AdviceListenerAdapter.java 6KB
共 719 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
野生的狒狒
- 粉丝: 3396
- 资源: 2436
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 没用333333333333333333333333333333
- 基于Vue和SpringBoot的企业员工管理系统2.0版本设计源码
- 【C++初级程序设计·配套源码】第2期-基本数据类型
- 基于Java和Vue的kopsoftKANBAN车间电子看板设计源码
- 影驰战将PS3111 东芝芯片TT18G23AIN开卡成功分享,图片里面画线的选项很重要
- 【C++初级程序设计·配套源码】第1期-语法基础
- 基于JavaScript、CSS、HTML的简易DOM版飞机游戏设计源码
- 基于Java开发的日程管理FlexTime应用设计源码
- SM2258XT-BGA144-4BGA180-6L-R1019 三星KLUCG4J1CB B0B1颗粒开盘工具 , EC, 3A, 94, 43, A4, CA 七彩虹SL300这个固件有用
- GJB 5236-2004 军用软件质量度量
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功