-
- 加入Spring-Boot-devtools 依赖
org.springframework.boot
spring-boot-devtools
true
- 加入Spring-Boot-devtools 依赖
2.启动的时候的加载器
当我们再次启动的时候,使用的加载器就变为了 restartedMain 了,说明热部署已经成功。
3.修改IDEA配置
(1)“File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。
- 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running” 。
本文详细介绍如何通过添加Spring Boot DevTools依赖实现应用的热部署,包括配置IDEA以支持自动编译和热更新,确保代码修改后无需重启即可生效。
2448

被折叠的 条评论
为什么被折叠?



