1. 添加热部署框架支持
在pom.xml中添加如下框架引用:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2.Settings 开启项目自动编译
新创建项目的设置
3.开启运行中热部署
(老版本IntelliJ IDEA 2021.2之前版本)
按两下Shift键,开启搜索
找到 compiler.automake.allow.when.app.running
作者这里是2021.3所以没有~~
(IntelliJ IDEA 2021.2之后版本)
idea热部署本质是重启Spring Boot项目,但是idea热部署有3s左右的延迟