IDEA 设置热部署 Devtools

热部署 Devtools:

  1. Adding devtools to your project
  2. Adding plugin to your pom.xml
  3. Enabling automatic build
  4. Update the value of
  5. Restart IDEA(不一定需要)

在要热部署的项目中,加入 devtools 的依赖

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

父 pom 中加入插件,并且配置

<build>
  <finalName>xxxx</finalName>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <fork>true</fork>
        <addResources>true</addResources>
      </configuration>
    </plugin>
  </plugins>
</build>

设置自动 build

原文地址:https://www.cnblogs.com/shuiyj/p/13090109.html