- pom.xml
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
- application.properties
debug=true
spring.devtools.restart.enabled=true
- Settings设置,勾选Build project automatically
![settings](https://i-blog.csdnimg.cn/blog_migrate/b0f8cb4372c6752348fdabc72d4f35b8.png)
- Ctrl+Shift+A,搜索Registry,并选中compiler.automake.allow.when.app.running打勾
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/5374ed015d33a5d16d799bf789b087c0.png)