1:在pom.xml 中 配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
注意:並不是pom.xml 的<build>標簽中
如果我們想指定讓 devtools 監聽指定文件夾,那么可以在 application.yml 配置spring.devtools.restart.additional-paths=your path,注意這里需要改成 yml 文件的格式。
2: 如果有頁面的話 禁止頁面緩存
spring:
application:
name: XXX
aop:
proxy-target-class: true
thymeleaf:
cache: false
prefix: classpath:/templates/
mode: LEGACYHTML5
3:開idea工具的自動編譯功能

最后 組合鍵:“Shift+Ctrl+Alt+/” ,選擇 “Registry” ,選中打勾 “compiler.automake.allow.when.app.running” 。
完成以上步驟 即可實現SpringBoot項目自動編譯+熱部署,這我們修改后的代碼能夠立刻看到效果,提高效率
