这里记录一下SpringBoot项目用到的热部署插件Devtools
首先在要用到热部署的模块的pom.xml中添加上Devtools的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
然后在当前模块或者父模块的pom.xml中添加一个插件
<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>
然后点击设置 将这四个打上√
最后在IDEA中按快捷键 ctrl+alt+shift+/ 弹出
点击第一个 将这两个打上√ 就OK啦 如果没有成功 重启一下IDEA
注意:热部署仅在开发阶段用,如果项目要上线 请关闭热部署功能