1. 关闭 thymeleaf 缓存
在 application.properties 或者 application.yml 中设置
spring.thymeleaf.cache=false
2. 引入热部署包
<!-- 热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
需要进行下面的设置
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- fork: 如果没有该项配置, 肯定 devtools 不会起作用, 即应用不会 restart -->
<fork>true</fork>
</configuration>
</plugin>
在 application.properties 或者 application.yml 中设置
# 热部署生效
devtools.restart.enabled=true
#设置重启的目录
devtools.restart.additional-paths=resources/**,static/**,templates/**
#该目录下的内容修改不重启
devtools.restart.exclude=data/**
配置文件发黄警告:
https://blog.csdn.net/YKenan/article/details/105933314
3. 修改设置
3.1
3.2
Ctrl+Shift+Alt+/