1.添加pom.xml添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
2.在<build><plugins>下<configuration>内添加<fork>true</fork>
3.设置idea自动编译
3.1 勾选Build Project automatically
3.2 快捷键 ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running
高版本idea通过以上方法找不到Compiler autoMake allow when app running,则通过以下方式: