jreble安装及破解方法
2023年1月10日大约 2 分钟约 542 字
jreble 安装及破解方法
在项目开发的过程中我们经常要重启项目进行代码的重新加载,在大项目开发的过程中这种不断的重新启动项目会浪费很多时间,在 IDEA 中我们可以使用 ctrl+F9 的方式进行热加载,但是这种方式对方法名的修改,和新加方法不能很好的支持。本章我们讲解一下功能强大的 jrebel 热加载工具,可以在不重启的情况下对新加的类、方法的修改都有很多好的支持,可以在实际项目开发中节省大量的时间,下面我们就一步一步开始进行安装设置。 **
一、安装插件

二、获取 git 代理服务器文件
ilanyu/ReverseProxygithub.com/ilanyu/ReverseProxy/releases/tag/v1.0

安装运行文件,监听端口 8888

三、运行 IDEA 激活
访问: Generate GUIDs online生成 ID ,选择激活服务器激活:

服务器写入 http://127.0.0.1:8888/网站获取的 ID 邮箱随便填写。
稍等一下会出现激活界面:

四、在 maven 配置加入 jrebel
<build>
<plugins>
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>1.1.8</version>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
五、设置编译方式
1) 设置为自动编译项目

2) ctrl+alt+shit + / 调用 register 勾选
并找到图中红框的选项"compller.automake.allow.when.app.running"并勾选
close 掉即可,此时已经生效,修改代码后 ctrl+s 会自动重新编译

六、启动测试
启动 jrebel 功能: debug

项目启动完成在 controller 加入新方法,可以看到控制台输出热部署记载提示。
在 idea 中自带的 ctrl+f9 可以在不修改方法的情况下进行热加载,添加或修改后就不能重新编译了。

访问测试
可以看到新加方法生效了。