版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u011066470/article/details/88379852
1、SpringBoot2.x使用Dev-tool热部署
在pom文件中添加核心依赖包:
<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
改代码不重启,通过一个文本去控制