Springboot配置devtools热部署
2019-01-23 本文已影响0人
大白乐了
1.pom.xml中新增
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.application.properties中新增
########################热部署配置 start#########################
#热部署生效
spring.devtools.restart.enabled=true
#设置重启的目录,默认java
#spring.devtools.restart.additional-paths=xx/js,xx/css
#classpath目录下的WEB-INF文件夹内容修改不重启
spring.devtools.restart.exclude=static/**,templates/**
#禁止日志报告
spring.devtools.restart.log-condition-evaluation-delta=false
#########################热部署配置 end#########################
3.idea配置自动编译
![](https://img.haomeiwen.com/i15982496/c41e9283f4268ce6.png)
ctrl+shift+alt+/
![](https://img.haomeiwen.com/i15982496/96393bd97c943b23.png)
![](https://img.haomeiwen.com/i15982496/2b09e9869dbe9191.png)
4.测试devtools热部署
![](https://img.haomeiwen.com/i15982496/a093f5c017e9dbe5.png)