1、添加devtools 依赖和pom插件
<!-- devtools 依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<!-- devtools 插件 -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
2、IDEA配置自动编译
![](https://img-blog.csdnimg.cn/202107271409369.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L015cm9uQ2hhbQ==,size_16,color_FFFFFF,t_70)
Ctrl+Alt+Shift+/ ---->> registry? ---->> 打勾
![](https://img-blog.csdnimg.cn/img_convert/f162c4843c178f289f17ccbc81f7ba78.png)
?
?
?
?
|