idea中实现springboot热部署
热部署:每一次修改代码后会自动更新,无需每次重启
依赖(pom.xml)
修改后记得reload一下
<dependency>
<groupid>org.springframework.boot</groupid>
<artifactid>spring-boot-devtools</artifactid>
<scope>runtime</scope>
<optional>true</optional>
</dependency>application.properties
# 热部署 spring.devtools.restart.enabled=true
settings
1.搜索compiler,勾选build project automatically

2.advanced settings->勾选
allow auto-make to start even if developed application is currently running

加快热部署速度
现在springboot就可以自动热部署了,效果还不错,但是感觉速度有点慢。
settings->languages & frameworks->spring->spring boot
设置refresh health in the actuator tab ewver为1

总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论