这里使用 springboot-devtools
导入坐标
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency>此时热部署已经生效,但是还需要手动点击
Build project或者按快捷键Ctrl+F9来让 idea 重新构建项目(编译修改后的类)开启自动构建:
在 idea 中开启
Settings -> Complier -> Build project automaticallyidea 版本:2022.2
开启
Settings -> Advanced Settings -> Allow auto-make to start even if developed application is currently running