SpringBoot启动热部署
1.在pom.xml中添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- optional=true, 依赖不会传递, 该项目依赖devtools;
之后依赖boot项目的项目如果想要使用devtools, 需要重新引入 -->
<optional>true</optional>
</dependency>
pom.xml2.修改application.properties文件
这一步根据实际情况来设置,一般可设置在开发环境即可;
spring.devtools.restart.enabled=true
application.properties3.idea的修改
3.1 File-Settings-Compiler-Build Project automatically
idea的设置3.2
ctrl + shift + alt + /然后选择Registry,勾上 Compiler.autoMake.allow.when.app.running
4.修改java文件,然后保存;待控制台出现了以下数据表示重启完成;
5.开发的时候有时候热部署无效,还是得重启,不能死磕;
注:本文转载于:https://blog.csdn.net/qq_37598011/article/details/80778915
网友评论