Springboot devtools的热部署配置总共有三步
1、jar 包引入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2、插件配置 需要设置fork为true属性
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
3、如果使用了模板thymeleaf,需设置不缓存,没有使用不需要配置
spring.thymeleaf.cache=false
4、IntelliJ IDEA工具的设置,有两个地方
(1)File-Settings-Compiler-Build Project automatically
(2)ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running
网友评论