热部署工具devtools的搭建

首先在子工程添加pom依赖

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

接着是父工程添加build

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

设置一下
在这里插入图片描述
接着,在父工程pom文件中按Ctrl+Alt+Shirt+/组合件,弹出来点第一个
在这里插入图片描述
然后打两个勾,之后close
在这里插入图片描述重启idea即可。
注:使用druid数据源重启后可能会报错,不用管它,不影响使用
热部署只会在开发阶段开启,在生产阶段(产品上线)后必须关闭

猜你喜欢

转载自blog.csdn.net/liuliusix/article/details/108847831