springboot在idea实现热部署

1.在pom.xml引入热部署devtools依赖

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

2.在pom.xm的下面的plugin 添加如下:

<configuration>
     <fork>true</fork>
</configuration>

3.编辑完pom.xml文件后,需设置两个地方

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

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

猜你喜欢

转载自www.cnblogs.com/QW-lzm/p/8972107.html