1.加入spring-boot-devtools依赖
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
2.开启idea的自动编译功能
3.同时按下Shift + Ctrl + Alt +/ 选择Registry 见下图