1、在项目的pom.xml文件中添加热部署依赖及build
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
2、在File->Settings->Build->Complier中,勾选以下选项
3、使用快捷键ctrl+shift+alt+/,选择Registry,勾选以下选项
4、重启IDEA,即可实现热部署