1、修改启动配置

SpringBoot配置资源文件自动热更新-LMLPHP

On update action 和 On frame deactivation 添加 update classes and resources 配置
SpringBoot配置资源文件自动热更新-LMLPHP

2、IDEA菜单栏File->setting->Build,Execution,Deployment->Compiler 勾选Build project automatically

SpringBoot配置资源文件自动热更新-LMLPHP

3、禁用Thymeleaf的缓存

在开发环境中,通过配置Thymeleaf来禁用其模板缓存。在每次请求页面时,Thymeleaf都会重新加载和解析模板文件。
全局配置文件application.properties添加配置如下,

spring.thymeleaf.cache=false

或者在application.yml文件中:

spring:  
  thymeleaf:  
    cache: false
03-15 01:01