idea通过导入依赖实现热部署

一、子模块导入Devtools依赖

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

二、父工程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>

三、修改idea设置

在这里插入图片描述
设置完成关闭设置窗口, ctrl+Shift+alt+/ 选择Registry
在这里插入图片描述
勾选以下选项
在这里插入图片描述
在这里插入图片描述
勾选完成ok,关闭窗口,重启idea完成设置。


版权声明:本文为weixin_43469882原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。