1.添加maven依赖
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2.把配置黏贴到父工程当中的pom里
<build>
<plugins>
<plugin>
<!--热部署-->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.2.RELEASE</version>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
3.在idea打开settings并找到Compiler
(把选中的点上勾)

4. 操作 Ctrl+shift+Alt+/
(进入1.Registry)
5.选中红色箭头所指的地方并勾选
6.重启idea