SpringBoot-热部署Devtools

步骤

  1. Adding devtools to your project

    1
    2
    3
    4
    5
    6
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <scope>runtime</scope>
    <optional>true</optional>
    </dependency>
  2. Adding plugin to your pom.xml

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <!--热启动插件-->
    <build>
    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
    <fork>true</fork>
    <addResources>true</addResources>
    </configuration>
    </plugin>
    </plugins>
    </build>
  3. Enabling automatic build

    image-20210320150622714

  4. Update the value of

    1. win: ctrl+shift+Alt+/ and search for the registry

    2. Mac: option+command+shift+/

    3. In registry, check

      image-20210320150956559

      image-20210320151047275

  5. restart IDEA