#### 1、maven引入依赖
在pom.xml加入配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
#### 2、修改IDEA配置
File->Settings->Compiler
按ctrl + shift + alt + /然后选择Registry,勾上这个
IDEA载入配置(run->Edit Configurations)
大功告成!