maven依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
idea设置
File-Settings-Compiler-Build Project automatically
ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running
修改代码后不操作一段时间idea自动重新编译
参考: