1 pom中添加 spring-boot-devtools
依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </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/