SpringBoot2.x使用Dev-tool热部署
官方地址:https://docs.spring.io/spring-boot/docs/2.1.0.BUILD-SNAPSHOT/reference/htmlsingle/#using-boot-devtools
核心依赖包:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
添加依赖后,在ide里面重启应用,后续修改后马上可以生效
不被热部署的文件
1、/META-INF/maven, /META-INF/resources, /resources, /static, /public, or /templates
2、指定文件不进行热部署 spring.devtools.restart.exclude=static/**,public/**
3、手工触发重启 spring.devtools.restart.trigger-file=trigger.txt
改代码不重启,
本文介绍了SpringBoot2.x如何使用Dev-tools进行热部署,包括核心依赖、排除不热部署的文件及手动触发重启的设置。同时,文章详细对比了xml、yml和properties配置文件的区别和使用,以及如何将配置文件内容自动映射到属性和实体类。还讨论了配置文件加载方式、常见问题和解决方案。
订阅专栏 解锁全文
583

被折叠的 条评论
为什么被折叠?



