標籤:jrebel 熱部署
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.
接下來,就可以開始開發,熱部署
JRebel + Tomcat + eclipse 實現熱部署