IDEA中实现springboot热部署方式
更新时间:2024年09月23日 10:18:06 作者:超级小的大杯柠檬水
在IDEA中实现SpringBoot的热部署可以通过修改设置来完成,首先在设置中搜索Compiler,并勾选Build project automatically,然后进入Advanced Settings,勾选Allow auto-make to start even if developed application is currently running
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

总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
Spring Boot中Elasticsearch的连接配置原理与使用详解
在Spring Boot中,我们可以通过Elasticsearch实现对数据的搜索和分析,本文将介绍Spring Boot中Elasticsearch的连接配置、原理和使用方法,感兴趣的可以了解一下2023-09-09


最新评论