有勇气的牛排博客

SpringBoot (四) 整合热部署 & idea配置

有勇气的牛排 500 Java 2023-02-25 13:17:36

哈喽,大家好,我是有勇气的牛排(全网同名)🐮🐮🐮

有问题的小伙伴欢迎在文末评论,点赞、收藏是对我最大的支持!!!。

文章目录

前言

什么是热部署

热部署:指在做软件开发运行的时候,不需要重启应用,只适合开发使用,线上不安全,容易被攻击。
热部署可以提高本地开发效率。

修改java类或页面静态文件,不需要手动重启

原理:类加载器

1 Maven依赖

<!--SpringBoot热部署配置 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency>

2 IDEA配置

1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。

image20230131233743438.png

2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running”

image20230131235703642.png

image20230131235726810.png

参考:

  • 余胜军

留言

专栏
文章
加入群聊