Spring Boot 3.x 全新的热部署配置方式详解(IntelliJ IDEA 2023.1)
作者:江帅帅
今天在暨大给学生上课的时候,发现在 Spring Boot 项目中配置热部署的方式有一丢丢的改变,具体往下看。
最近还把 IDEA 更新到了 IntelliJ IDEA 2023.1 版本

第一步,在 pom.xml 文件中添加依赖
<!--热部署配置 -->
 <dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-devtools</artifactId>
     <!-- 表示依赖不向下传递 -->
     <optional>true</optional>
 </dependency>第二步,配置 Build project automatically
如果你用的是 Windows 系统,请按照 file -> settings -> Build, Execution, Deployment -> compiler 这个路径找到 build project automatically 并勾上,最后 Apply 和 OK 即可;
如果你用的是 Mac 系统,请按照 IntelliJ IDEA -> settings -> Build, Execution, Deployment -> compiler 这个路径找到 build project automatically 并勾上,最后 Apply 和 OK 即可。

第三步,开启允许在运行中修改文件
如果你用的是 Windows 系统,请按照 file -> settings -> Advanced Settings 这个路径找到 Allow auto-make to start even if developed application is currently running 并勾上,最后 Apply 和 OK 即可;
如果你用的是 Mac 系统,请按照 IntelliJ IDEA -> settings -> Advanced Settings 这个路径找到 Allow auto-make to start even if developed application is currently running 并勾上,最后 Apply 和 OK 即可;

到此这篇关于Spring Boot 3.x 全新的热部署配置方式(IntelliJ IDEA 2023.1)的文章就介绍到这了,更多相关Spring Boot 3.x 热部署配置内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
