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配置热部署

相关文章:

  • 2021-12-08
  • 2021-05-18
  • 2022-03-04
  • 2022-02-08
  • 2021-08-15
  • 2022-02-15
  • 2021-08-08
  • 2021-08-10
猜你喜欢
  • 2022-12-23
  • 2021-07-08
  • 2021-08-07
  • 2021-08-09
  • 2021-05-16
  • 2021-12-28
相关资源
相似解决方案