IntelliJ IDEA中SpringBoot项目通过devtools实现热部署

一、添加依赖

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

二、开启热部署

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

三、启动自动构建

Image 181.png

四、启动自动make

Windows IDEA: ctrl + shift + Alt + / -> 1. Registry... -> compiler.automake.allow.when.app.running 勾上