SpringBoot的热部署
1.pom文件中添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!--当前这个项⽬被继承之后,这个不向下传递-->
<optional>true</optional>
</dependency>
2.pom文件中添加插件:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork><!-- 如果没有该配置,热部署的devtools不⽣效 -->
</configuration>
</plugin>
3.yml文件配置
## 热部署配置
spring:
devtools:
restart:
enabled: true
additional-paths: src/main/java
poll-interval: 3000
quiet-period: 1000
注意每一级要对齐,胆大心细。
4.修改全局设置
第五项的Build Project automatically勾选上。
5.Registry配置
ctrl+shift+alt+/
快捷键选择Registry,勾上 Compiler autoMake allow when app running
从Compiler开头开始找