springboot 热部署
- 打开设置 --> 查找 build project automatically --> 选中
- 打开设置 --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running
如果没有这个配置项(新版本没有):
打开设置 --> 查找Registry--->进入keymap 设置Registry 快捷键
找到并勾选compiler.automake.allow.when.app.running
- 然后重启idea
- 引入 jar 依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
- 引入插件
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
- application.properties 里添加
spring.devtools.restart.enabled=true
以上操作之后,热部署配置成功,建议在 google开发者选项中,关闭浏览器缓存,便于调试。