热部署Devtools

热部署的作用是代码改动自动重启,不需要人工手动重启,方便调试!

步骤:

1. 在子module中的POM.xml中添加引用

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

2.在父POM.xml中添加plugin

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

 

 

3.开启设置

4.更新值

ctrl+shift+Alt+/

 

 

 

 

5 重启IDEA

关闭IDEA重新开启,编写代码后ctrl+s保存,过一会就会自动重启。

posted @ 2021-10-11 08:42  创客未来  阅读(69)  评论(0编辑  收藏  举报