Intellij IDEA下使用 Spring-boot-devtools 热部署无效问题

1、添加依赖

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

2、配置 plugin

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

3、快捷键 Shift+Ctrl+Alt+/,选择Registry,然后选中

Compiler autoMake allow when app running
在这里插入图片描述

效果

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43577800/article/details/89711241