SpringBoot IDEA热部署

pom.xml的dependency
1
2
3
4
5
6
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!--<scope>runtime</scope>-->
<optional>true</optional>
</dependency>
pom.xml的build
1
2
3
4
5
6
7
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
<!--<addResources>true</addResources>--> </plugin>
application.yml关闭缓存
1
2
3
spring:
thymeleaf:
cache: false
开启自动编译
1
2
3
// 在IDEA的配置中配置自动化编译
File -> Settings -> Build, Execution, Deployment -> Compiler -> Build project automatically //勾选
// apply
配置Registry (Ctrl+Shift+A => Registry)
1
compiler.automake.allow.when.app.running //勾选 -> Close