idea springBoot 配置devtools实现热部署

1、pom文件依赖引入

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>true</fork><!-- 如果没有该配置,devtools不会生效 -->
            </configuration>
        </plugin>
    </plugins>
</build>

2、IDEA配置

ctrl + shift + A,输入automatically,选择如图所示点击进入

然后ctrl + shift + alt + /,选择如下图所示点击进入

 

保存重启,之后修改文件进行测试即可

猜你喜欢

转载自www.cnblogs.com/kingsonfu/p/10388391.html