项目配置依赖
Maven,添加1
2
3
4
5<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
Gradle,添加1
runtime('org.springframework.boot:spring-boot-devtools')
IDEA设置
File -> Settings -> Build, Exception, Deployment -> Compiler
Make project automatically勾选上
Ctrl + Shift + A
,输入Registry
找到 compiler.automake.allow.when.app.running,勾选上