IDEA之SpringBoot热部署
一.SpringBoot pom文件
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
二.配置application.yml
# Spring配置
spring:
# 服务模块
devtools:
restart:
enabled: true # 热部署开关
additional-paths: src/main/java #重启目录
exclude: templates/** #classpath目录下的templates文件夹内容修改不重启
三.配置IDEA
配置一
File->Settings->Build,Execution,Deployment->Compiler
√ Build project automatically 勾选
配置二
ctrl + shift + alt + /
选择Registry,勾上 Compiler autoMake allow when app running
找到compile.document.save.trigger.delay,和compile.automake.trigger.delay,数值设置的小一些(这里设置为99)