作者:亲爱的常青藤先生 | 来源:互联网 | 2023-05-18 10:55
1 pom中添加 spring-boot-devtools
依赖
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-devtoolsartifactId>
<optional>trueoptional>
dependency>
2 更改设置
选中 File->Setting –> Build, Execution, Deployment –> Compiler–>
Build project automatically
3 SHIFT+CTRL+A
输入 registry 在弹出的窗口中
找到compiler.automake.allow.when.app.running 打上勾
参考:
1 https://***.com/questions/33349456/how-to-make-auto-reload-with-spring-boot-on-idea-intellij
2 https://www.mkyong.com/spring-boot/intellij-idea-spring-boot-template-reload-is-not-working/