1. 在所属模块添加 devtools pom依赖
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
2.在父工程 pom里添加
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork> <!--重要-->
</configuration>
</plugin>
</plugins>
</build>
3.在idea里点击项目-->settting-->Compiler(搜索框可以搜索)
3.1第一步

3.2第二步

3.3第三步,ctrl+shift+alt+/

3.4 找到图中那个,打钩,然后close

3.5最后一步;重启idea
网友评论