1. 添加依赖开启热部署
<!-- 开启热部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- 设置为true 热部署才有效 -->
<optional>true</optional>
<scope>true</scope>
</dependency>
2. 配置插件,让依赖生效
<!-- 配置插件,让热部署依赖spring-boot-devtools生效 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 设置为true,让热部署devtools生效 -->
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
3. 设置开启自动构建项目
File -> Settings -> 搜索Compiler -> 开启`Build Project automatically`
4. 改变注册表,开启Compiler.autoMake.allow.when.app.running
双击Shift,输入registry
搜索找到Action的Registry,然后开启Compiler.autoMake.allow.when.app.running
5. 将项目设置为update classes and resources
6. 将项目加入到Jrebel中