1.在maven中进行配置
<!--springBoot工程实现热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork><!--注意要修改这里-->
</configuration>
</plugin>
2.application.properties/application.yml中,Thymeleaf等视图页面禁用缓存
spring.thymeleaf.cache=false
spring.freemarker.cache=false
spring.groovy.template.cache=false
spring.velocity.cache=false
3.IDEA中开启自动编译
File->Other Settings->Default Settings找到全局设置界面 ->
Build,Execution,Deployment -> Compiler -> 勾选 Make project automatically(only works while not running / debugging)
4.修改IDEA行为
组合键:Shift+ALT+Ctrl+/ ,选择Registry–>勾选 compiler.automake.allow.when.app.running
5.谷歌浏览器中禁用缓存
CTRL+SHIIFT+J进入开发者界面中 -> Network 选项 -> 勾选Disable cache