idea 配置springboot 热部署

1. 增加依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>

2. 开启热部署支持

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--fork:设置True,否则可能devtools不会起作用-->
<fork>true</fork>
</configuration>
</plugin>

3. 测试

  • mvn spring-boot:run启动工程
  • 修改代码
  • Ctl+s保存代码,Ctl+F9编译
  • 查看到新的结果

猜你喜欢

转载自www.cnblogs.com/lmjsdoit/p/11818331.html