本文主要是介绍Eclipse/IntelliJ IDEA添加JRebel 6.4.4以实现Tomcat热部署,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
原址:点击打开链接
Eclipse/IntelliJ IDEA添加JRebel 6.4.4以实现Tomcat热部署
Index Eclipse平台 围观1783次 6条评论 创建时间:2015年11月19日 繁體中文 大 中 小最近,JRebel更新到了6.4.4。更新内容见:JRebel 6.x Changelog
JRebel 可快速实现Tomcat的热部署,最为强大的是支持Spring注解的热部署,这样就能节省大量的服务器重启时间,提高了个人开发效率。
JRebel支持Eclipse和IntelliJ IDEA,下面分别从两个IDE介绍JRebel的安装方法,如有错误或遗漏,欢迎指出。
安装方法
1.Eclipse安装JRebel
Eclipse插件在线安装地址:
1 | http : //update.zeroturnaround.com/update-site/ |
添加插件在线安装地址到Eclipse,然后选择安装 JRebelforJavaEE,重启之后设置里会出现 Jrebel的选项,说明安装成功。
Crack:
打开Eclipse目录:plugins/org.zeroturnaround.eclipse.embedder_*
分别替换 jrebel,jr6/jrebel 文件夹里的jar文件为破解后的jar文件,将证书放到用户文件夹的 .jrebel 文件夹下,例如 ~/.jrebel/。
回到Eclipse,选择Help -> JRebel Configuration 打开jrebel的配置中心,到Advance里设置JRebel agent为JRebel 6 Agent。
如果Jrebel提示没激活,请手动选择一下注册证书的路径。
设置好之后,在已有项目上右键 -> Jrebel -> Add Jrebel Nature,然后源码目录就会生成一个 rebel.xml 文件,设置成功。
2.IntelliJ IDEA安装JRebel插件:
以下步骤基于IntelliJ IDEA 15,其他版本大同小异。
File -> Settings -> Plugins -> Browse repositories...
查找 JRebel for Intellij 并安装。
Crack:
可以使用第三方授权服务器:http://idea.lanyus.com/img/JRebel.png
还是那句话,如果JRebel给你节约了大量时间,而你又的确喜欢这款软件,请买正版支持一下。
打开插件目录:C:/Users/<当前用户>/.IntelliJIdea15/config/plugins/jr-ide-idea/lib
,或者 ~/.IntelliJIdea15/config/plugins/jr-ide-idea/lib。
分别替换 jrebel 和 jrebel6 里边的jar文件为破解后的jar文件,并将注册证书放到 C:/Users/<当前用户>/.jrebel/ 文件夹下,或者 ~/.jrebel/。
回到IntelliJ IDEA:File -> Settings -> JRebel
,确认一下注册状态,然后到 Advanced 选择JRebel 6 Agent。
使用:
在当前项目上右键 -> JRebel -> rebel.xml 来生成 rebel.xml 文件,或者在IntelliJ左下角,选择JRebel选项卡,将第一个勾上即可。(不做这步也可以)
Run -> Edit Configurations...
,设置On ‘Update action’ 和 On firame deactivation。
PS:官方文档里边给出的是分别设置为“Restart server”和“Do nothing”,但是需要手动编译才能自动部署。我推荐设置为如下图,当IDEA失去焦点的时候会自动编译并重新部署,更方便。
IntelliJ安装JRebel官方教程:IntelliJ IDEA — JRebel documentation
3.JRebel使用说明
项目下的src/rebel.xml
文件配置的是JRebel的监控路径,如果使用不正常,请确认一下这个文件里边配置的路径是否正确。
启动项目,如果提示类似以下信息,说明JRebel运行正常:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 2015 - 11 - 25 09 : 00 : 18 JRebel : 2015 - 11 - 25 09 : 00 : 18 JRebel : ############################################################# 2015 - 11 - 25 09 : 00 : 18 JRebel : 2015 - 11 - 25 09 : 00 : 18 JRebel : JRebel Agent 6.2.7 ( 201511061217 ) 2015 - 11 - 25 09 : 00 : 18 JRebel : ( c ) Copyright ZeroTurnaround AS , Estonia , Tartu . 2015 - 11 - 25 09 : 00 : 18 JRebel : 2015 - 11 - 25 09 : 00 : 18 JRebel : Over the last 1 days JRebel prevented 2015 - 11 - 25 09 : 00 : 18 JRebel : at least 0 redeploys / restarts saving you about 0 hours . 2015 - 11 - 25 09 : 00 : 18 JRebel : 2015 - 11 - 25 09 : 00 : 18 JRebel : Licensed to VIMACER ( ZeroTurnaround ) 2015 - 11 - 25 09 : 00 : 18 JRebel : with the following restrictions : 2015 - 11 - 25 09 : 00 : 18 JRebel : ### Hello World Cracked ### :) 2015 - 11 - 25 09 : 00 : 18 JRebel : 2015 - 11 - 25 09 : 00 : 18 JRebel : License type : enterprise 2015 - 11 - 25 09 : 00 : 18 JRebel : Valid from : July 14 , 2014 2015 - 11 - 25 09 : 00 : 18 JRebel : Valid until : August 18 , 2888 2015 - 11 - 25 09 : 00 : 18 JRebel : 2015 - 11 - 25 09 : 00 : 18 JRebel : 2015 - 11 - 25 09 : 00 : 18 JRebel : ############################################################# 2015 - 11 - 25 09 : 00 : 18 JRebel : |
下载地址
JRebel免安装版本下载地址(可直接挂载到Tomcat):
1 | https : //zeroturnaround.com/software/jrebel/download/thank-you/?file=jrebel-6.4.4-nosetup.zip |
注:Eclipse也可以尝试使用授权服务器激活:http://idea.lanyus.com/img/JRebel.png
这篇关于Eclipse/IntelliJ IDEA添加JRebel 6.4.4以实现Tomcat热部署的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!