SpringBoot2.x配置热部署

pom.xml

  1. 添加spring-boot-devtools

  2. 添加fork为true

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-devtools</artifactId>
  <!--编译时不会打包-->
  <scope>runtime</scope>
</dependency>

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <!--添加<fork>true</fork>-->
      <configuration>
        <fork>true</fork>
      </configuration>
    </plugin>
  </plugins>
</build>	

IDEA配置

  1. Preferences中检查并配置Build project automatically
  2. cmd+alt+shift+/ Registry中检查并配置compiler.automake.allow.when.app.running

SpringBoot2.x配置热部署
SpringBoot2.x配置热部署

上一篇:springboot热部署


下一篇:springboot(4)springboot热部署插件及idea热部署