Jrebel + eclipse + tomcat 用于热部署 的实践总结

1、用eclipse 下载 http://update.zeroturnaround.com/update-site


2、接着替换 your eclipse   location\plugins\org.zeroturnaround.eclipse.embedder_6.0.0.RELEASE-201410311652\jrebel ,即eclipse所在目录的plugins 替换jrebel里面的jar包。


3、去eclipse 中注册jrebel ,替换文件是jrebel.lic,提示注册成功

以上部分是注册部分


1、双击servers 下面的某个tomcat服务,点击overview,需要配置如下参数:

a、 Server Locations选择 User Tomcat installation

b、 Publishing中选择 Never publish automatically

c、 Timeouts中 Start设置成 1000或更大

d、 JRebel Integration中两个复选框都选中

e、选择Open lauch configuration,在(x)=Arguments选项卡中增加 配置VM arguments参数:

-noverify

-Drebel.struts2-plugin=true

-Drebel.spring_plugin=true

-Xms256m -Xmx256m -XX:MaxNewSize=256m -XX:MaxPermSize=256m



2、双击servers中下面某个tomcat服务,点击modules,添加你需要的module。 需要add external web module.注意document base 需要填写的是程序的webapp的位置,而非tomcat下编译的位置。如:


your project location\xxxxxx\WebApps


Path为要访问的程序web名


3、其次程序上右击选择jrebel,advanced properties.当然了,需要enable 一下jrebel。可以重新生成一下rebel文件。


4、至此,程序可以达到热部署了。


以上是使用插件模式。(一般没什么用)

-noverify
-javaagent:D:\xxxx\xxxxx\jrebel.jar
-Drebel.dirs=your project location\xxxx\WebApps\WEB-INF\classes,your project location\xxxx\WebApps\WEB-INF\classes\config,your project location\xxxxx\WebApps
-Drebel.spring_plugin=true
-Drebel.aspectj_plugin=true
-Drebel.struts2_plugin=true
-Drebel.hibernate_plugin=true
-Drebel.hibernate_validator_plugin=true

或者把这些加到tomcat的启动参数里面

最后要注意的是tomcat的modules中的某个module 的auto reload参数要配置成disabled


此方法经实践可用

猜你喜欢

转载自ernestyoung.iteye.com/blog/2158580
今日推荐