首先在pom.xml中添加devtools依賴html
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
由於IDEA修改代碼不會自動編譯,因此咱們須要修改:spring
1) 「File」 -> 「Settings」 -> 「Build,Execution,Deplyment」 -> 「Compiler」,選中打勾 「Build project automatically」 緩存
2) 組合鍵:「Shift+Ctrl+Alt+/」 ,選擇 「Registry」 ,選中打勾 「compiler.automake.allow.when.app.running」 app
禁用Chrome緩存:spring-boot
F12或者「Ctrl+Shift+I」,打開開發者工具,「Network」 選項卡下 選中打勾 「Disable Cache(while DevTools is open)」 工具
參考連接:https://www.cnblogs.com/sprinkle/p/7058630.htmlui