spring boot+ Intellj idea devtool 設定熱部署
阿新 • • 發佈:2019-02-09
兩步:
一、
1、CTRL + SHIFT + A --> 查詢make project automatically --> 選中2、CTRL + SHIFT + A --> 查詢Registry --> 找到並勾選compiler.automake.allow.when.app.running
最後重啟idea
二、使用spring-boot-1.3開始有的熱部署功能
1、加maven依賴
Xml程式碼
- <dependency>
-
<groupId>org.springframework.boot</
- <artifactId>spring-boot-devtools</artifactId>
- <optional>true</optional>
- </dependency>
2、開啟熱部署
Xml程式碼
- <build>
- <plugins>
- <plugin>
-
<groupId>org.springframework.boot</
- <artifactId>spring-boot-maven-plugin</artifactId>
- <configuration>
- <fork>true</fork>
- </configuration>
- </plugin>
- </plugins>
- </build>
三、Chrome禁用快取
F12(或Ctrl+Shift+J或Ctrl+Shift+I)--> NetWork --> Disable Cache(while DevTools is open)
至此,在idea中就可以愉快的修改程式碼了,修改後可以及時看到效果,無須手動重啟和清除瀏覽器快取