Jrebel+tomcat實現熱部署
在 Java Web 開發中, 一般更新了 Java 文件后要手動重啟 Tomcat 服務器, 才能生效, 浪費不少生命啊, 自從有了 JRebel 這神器的出現, 不論是更新 class 類還是更新 Spring 配置文件都能做到立馬生效,大大提高開發效率,
先下載Jrebel,放置到某盤中;
1、 雙擊tomcat進入配置
2、 添加tomcat運行參數
-Drebel.spring_plugin=true
-Drebel.aspectj_plugin=true
-Drebel.struts2_plugin=true
-javaagent:D:\jrebel\jrebel\jrebel.jar //Jrebel的實際路徑
-noverify
3、 去掉tomcat自動加載選項
4、 在項目根目錄下新建rebel.xml
<?xml version="1.0" encoding="UTF-8"?>
<application>
<classpath>
<dir name="WebContent\WEB-INF\classes" /> //項目class文件路徑
</classpath>
<web>
<link target="">
<dir name="WebContent" /> //項目路徑
</link>
</web>
</application>