1pom.xml中
<dependencies>
<!--整合web-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>1.5.14.RELEASE</version>
<optional>true</optional>
</dependency>
<!--测试-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
2pom.xml中
<build>
<plugins>
<!--maven-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--maven-->
<!--热部署-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
<!--热部署-->
</plugins>
</build>
3、设置自动编译保存后的Java文件
4、idea 注册 自动编译功能(默认是关闭状态),快捷键 Ctrl + Shift + Alt + / ,然后选择 register 找到 complier.automake.allow.when.app.running 然后勾上就可以了。(