版本:IDEA Community 2019.2.2,Spring Boot 2.1.8.RELEASE
流程:pom文件中添加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
=》pom文件中spring-boot-maven-plugin添加configuration节点,改为:
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
=》File=>Setting=>Compiler=>勾选Build project automatically=》保存
=》ctrl+shift+alt+/=》Registry=>Comliler.automake....app.running 勾选
=》在项目运行期间修改代码后,会自定重新编译运行