IDEA-SpringBoot热部署
-
什么是热部署
- 应用正在运行的时候升级功能,不需要重新启动应用
- 对于Java应用程序来说,热部署就是在运行时更新Java类文件
-
好处:不需要重新手工启动应用,提高本地开发效率
-
SpringBoot结合devtools实现IDEA项目热部署
-
pom文件添加依赖
<!--热部署--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork><!--必须添加这个配置--> </configuration> </plugin> </plugins> </build> -
IDEA设置
- 开启自动编译
![]()
- 使用快捷键
Ctrl+Shift+Alt+/打开,选择Registry
![]()
- 选择compiler.automake.allow.when.app.running勾上,重启IDEA
![]()
- 开启自动编译
-



浙公网安备 33010602011771号