開啓熱部署
1、pom添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.0.1.RELEASE</version>
<optional>true</optional>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 如果沒有該配置,devtools不會生效 -->
<fork>true</fork>
<!--支持靜態文件熱部署-->
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
2、Intellij IEDA開發工具
File->Setting->Build,…->Compiler 將右側project automatically勾上
使用ctrl+shift+a 快捷鍵搜索Registry,選擇搜索出來的第一個
找到compiler.automake.allow.when.app.running,勾上開啓此功能即可