1.pom文件加入热部署依赖
<!-- 热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
2.让Devtools生效
加入红色方框的内容
3.启用自动构建项目
File>Settings>build,Execution,Deplyment>compiler
4.启用在项目运行时,允许项目编译
同时按下 Ctrl + Shift + Alt + / 选择Registry
勾选compiler.automake.allow.when.app.running,勾选完点击close就行了