1. 修改pom.xml

<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> <!-- 如果没有该配置,devtools不会生效 -->
    </configuration>
</plugin>
2.修改application.propertis或application.yml

# 这个开发配置为false,避免改了模板还要重启服务器
spring.thymeleaf.cache=false
3. 设置IDEA

打开File->Setting->Build,Execution,Deployment->Compiler

1. 修改pom.xml

<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> <!-- 如果没有该配置,devtools不会生效 -->
    </configuration>
</plugin>
2.修改application.propertis或application.yml

# 这个开发配置为false,避免改了模板还要重启服务器
spring.thymeleaf.cache=false
3. 设置IDEA

打开File->Setting->Build,Execution,Deployment->Compiler

SpringBoot环境下thymeleaf 热部署 (界面自动刷新 )

快捷键  ctrl + shift + alt + / ,选择Registry,勾上 Compiler autoMake allow when app running

 

完成后,重启一下项目或IDEA。
————————————————
版权声明:本文为CSDN博主「ziyilanbing」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ziyilanbing/article/details/100540946

快捷键  ctrl + shift + alt + / ,选择Registry,勾上 Compiler autoMake allow when app running

 

完成后,重启一下项目或IDEA。
 

相关文章:

  • 2021-09-11
  • 2021-09-07
  • 2021-05-15
  • 2021-07-05
  • 2022-02-11
  • 2022-12-23
  • 2021-12-12
  • 2022-03-03
猜你喜欢
  • 2021-07-20
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2021-04-10
相关资源
相似解决方案