Jrebel 可快速实现热部署,节省了大量重启时间,提高了个人开发效率。
一:
下载地址为:
https://zeroturnaround.com/software/jrebel/download/prev-releases/
这里现在最新版的 jrebel-6.0.0-nosetup.zip
https://zeroturnaround.com/software/jrebel/download/thank-you/?file=jrebel-6.0.0-nosetup.zip
二:
下载eclipse eclipse-jee-luna-SR1-win32-x86_64.zip
打开后,在market中,输入jrebel,安装jrebel插件
三:
配置Server,这里用Tomcat7
新建maven webapp项目(这里是shop,其它的java web项目也可以),然后 右键 Run As -> Run On Server 运行之后,停掉
打开Servers中的配置server.xml
把
<Context docBase="shop" path="/shop" reloadable="true" source="org.eclipse.jst.jee.server:shop"/>
中的
reloadable改为false
四:
注册jrebel License
打开页面:https://zeroturnaround.com/software/jrebel/trial/
在右侧填入name,email等信息,就可以申请License
五:
选择Help -> Jrebel Config Center 打开jrebel的配置中心
1:在Overview tab 中。右侧 Licensing 填入上部申请的License
2:左边Servers中,勾选上一步需要运行的服务器
3:左下侧Projects,勾选需要开发的项目
4:切换到Advanced tab中,在右上侧的Jrebel agent
选择Other jrebel.jar 选择第一步下载的文件(提前解压,不要解压到中文、空格的目录) jrebel.jar
六:
启动tomcat,查看控制台输出
JRebel: Starting logging to file: C:\Users\Administrator\.jrebel\jrebel.log
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: #############################################################
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: JRebel Legacy Agent 6.0.0 (201410311556)
2014-11-22 12:04:59 JRebel: (c) Copyright ZeroTurnaround AS, Estonia, Tartu.
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: Over the last 1 days JRebel prevented
2014-11-22 12:04:59 JRebel: at least 1 redeploys/restarts saving you about 0 hours.
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: Licensed to apache hadoop
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: License type: evaluation
2014-11-22 12:04:59 JRebel: Valid from: November 21, 2014
2014-11-22 12:04:59 JRebel: Valid until: December 5, 2014
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: You are using an EVALUATION license.
2014-11-22 12:04:59 JRebel: Days left until license expires: 13
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: To extend your evaluation or purchase a license,
2014-11-22 12:04:59 JRebel: contact [email protected]
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: If you think this is an error, contact [email protected]
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel:
2014-11-22 12:04:59 JRebel: #############################################################
2014-11-22 12:04:59 JRebel:
当看到有如下输出,就表示成功
2014-11-22 12:05:02 JRebel: Directory ‘E:\eclipse-jee-kepler-SR2-win32-x86_64\src\shop\build\classes‘ will be monitored for changes.
2014-11-22 12:05:02 JRebel: Directory ‘E:\eclipse-jee-kepler-SR2-win32-x86_64\src\shop\WebContent‘ will be monitored for changes.
接下来,就可以开始开发,热部署