1.添加热部署依赖包
即pom文件中添加以下配置:
<dependencies>
<!-- 添加spring-boot-devtools热部署依赖包 start-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- 添加spring-boot-devtools热部署依赖包 end-->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--热部署节点配置 start-->
<configuration>
<fork>true</fork>
</configuration>
<!--热部署节点配置 end-->
</plugin>
</plugins>
</build>
2 idea设置
Ctrl+Alt+S>Complier>Build project automatically
Ctrl+Shiflt+Alt+/>Registry>勾选红圈标记项