【spring-boot】idea实现热部署

第一步: 打开设置,勾选自动构建项目选项

第二步:输入ctrl + shift + A 搜索Registry

第三步:勾选compiler.automake.allow.when.app.running

测试一波:

同时我们也可以在pom.xml中加入如下依赖:

<!-- 热部署模块 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
            <scope>true</scope>
        </dependency>

以及插件:

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

好了,洗澡去了,告辞!!!

猜你喜欢

转载自blog.csdn.net/evan_qb/article/details/81176513