springboot-devtools实现项目的自动重启

热部署的引入依赖:

<!-- 热部署 -->
        <dependency>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-devtools</artifactId>
           <scope>runtime</scope>
        </dependency>

在application.properties文件中

1)添加  spring.devtools.restart.enabled= false

      可以关闭SpringBoot的重启

2)添加  spring.devtools.restart.trigger-file=myRestartTrigger.my

 在resources下新建myRestartTrigger.my(触发器文件)文件, 可以在进行一系列操作之后,在myRestartTrigger.my文件写1保存,即可实现自动重启

可参考:https://jingyan.baidu.com/article/4b07be3c91976e48b380f304.html

猜你喜欢

转载自www.cnblogs.com/chcha1/p/10967117.html