1、引入依赖
<!-- springboot热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- 有时候其他都设置完了页面还是没有实时更新,可以增加这个试一下 -->
<scope>runtime</scope>
<!-- 重要 -->
<optional>true</optional>
</dependency>
2、在yml配置文件中增加以下配置
spring:
thymeleaf:
cache: false #取消缓存
devtools:
restart:
enabled: true #启用热部署
3、组合键 ctrl + shift + alt + / 呼出界面
选择Registry,然后找到下图红框中的行打上钩