IDEA中的SpringBoot热部署

POM.XML文件的配置

1.引入依赖包

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

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!--fork :  如果没有该项配置,devtools不会起作用,即应用不会restart -->
                    <fork>true</fork>
                </configuration>
            </plugin>
        </plugins>
</build>

IDEA编译器的设置
1.File–>Settings—>Build,Execution,Deploment
这里写图片描述

2.Intellij IEDA 使用ctrl+shift+a 快捷键搜索Registry,然后勾选compiler.automake.allow.when.app.running
这里写图片描述
这里写图片描述

猜你喜欢

转载自blog.csdn.net/ycd500756/article/details/80601810