JRebel + Tomcat + eclipse 實現熱部署

來源:互聯網
上載者:User

標籤: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 實現熱部署

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.