1.添加依赖
<!-- SpringBoot自带热加载开发工具 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
复制代码
2.配置IDEA-1
Preferences(win下为Settings)->Build,Execution,Deployment->Build project Automatically 勾选上
复制代码
3.配置IDEA-2
按中快捷键 shift+option+command+/(win 下为shift+alt+ctrl+/)选择registry
并勾选compiler.automake.allow.when.app.running
复制代码
4.设置静态资源不热加载
application.yml
spring:
devtools:
restart:
exclude: templates/**,static/**
复制代码
5.重启IDEA生效