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
快捷键 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。