热部署Devtools

一. Add devtools to your project

在子项目的pom文件中添加devtools的依赖

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

二. Add plugin to your pom.xml

在父项目的pom文件中添加插件

 <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>

三. Enabling automatic build

File---》setting ---》Build,Execution,Deployment---》Compiler

四.Update the value of

快捷键:ctrl+shift+alt+?

五. 重启IDEA

posted @ 2022-09-12 23:17  每天一个bug小技巧  阅读(25)  评论(0)    收藏  举报