安装JRebel
- 下载地址: https://zeroturnaround.com/software/jrebel/download/
- 配置环境变量 %JREBEL_HOME% 为 jrebel.jar 所在的目录
配置JRebel
- 配置licence Server:
Add host file entry:
<pre>xxx.xxx.xxx.xxx jrebel.server.com</pre>
- 激活
访问Lic server的Access Token之前发过邮件, 可以在插件中进行配置,或者运行JRebel目录下的GUI工具完成。
- 修改JRebel配置
同上可以在插件中配置
安装JRebel eclipse plugin ( 可选 )
-
从Eclipse市场安装
-
右键插件项目生成jrebel.xml文件,或者参照例子文件来生成 '
<?xml version="1.0" encoding="UTF-8"?> <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd"> <classpath> <dir name="C:/Work/%Project Name%/web/webroot/WEB-INF/classes" /> </dir> </classpath> </application>
'
配置Hybris
- 配置Hybris Server
<pre> tomcat.javaoptions=-Xverify:none -javaagent: "%JREBEL_HOME%/jrebel.jar=de.hybris.tomcat.HybrisWebappClassLoader60" </pre>
- 在Debug模式下运行JRebel的参数
<pre> tomcat.debugjavaoptions=-Xverify:none -javaagent: "%JREBEL_HOME%/jrebel.jar=de.hybris.tomcat.HybrisWebappClassLoader60" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address= 8000 ,suspend=n </pre>
-
在生成的JRebel.xml文件中加入类路径
<dir name="C:/Work/%Project Name%/web/webroot/WEB-INF/classes" />
=9
- Run Ant Deploy in the platform_home
使用
- 因为Eclipse的Build路径与实际路径不符, 使用ant build对代码进行编译,ant all之后hybris会自动重启。
- Spring的配置文件理论上是可以通过JRebel来实行实时加载的,有对应的插件,启动时JRebel也自动进行了加载,但是实际测试并没有成功。