转载自: https://blog.csdn.net/Edison_03/article/details/79764403
一、pom.xml添加依赖
<!-- 热部署组件 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork><!-- fork:如果没有该配置,这个devtools不会起作用 -->
</configuration>
</plugin>
</plugins>
二、修改idea默认配置
快捷键(ctrl + alt + s),Settings-Compiler-Build Project automatically
快捷键(ctrl + shift + alt + /),选择Registry,勾上 Compiler autoMake allow when app running。