如何开启热部署


如何开启热部署

1、添加依赖到你的项目中

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

2、添加插件到父类总工程的pom文件

  <build>
    <finalName>工程名字</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>

3、开启自动编译选项

image-20220717113816539

4、更新值

快捷键ctrl+shift+alt+/打开Registry

image-20220717114113665

选中选项

image-20220717114301825

image-20220717114325603

5、重启idea即可


Author: baiwenhui
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint policy. If reproduced, please indicate source baiwenhui !
  TOC