spring boot热部署的pom.xml
<!-- 热部署:当修改和创建了文件以后都需要重启项目。为了不频繁的重启,我们可以使用热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
如果配置好但是热部署无效,那么还需要修改idea中的两个配置
setting –> compiler 将 Build project automatically 勾选上
ctrl+alt+shift+/ 点击 Registry... 找到 compiler.automake.allow.when.app.running 勾选 close 快捷键也可能是 alt + shift + a