添加devtools依赖
xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
IDEA开启自动编译

开启运行中热部署
低版本需要双击shift搜索registry
高版本设置如下所示
DeBug启动项目
