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 + /,选择如下图所示点击进入

 

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

 

posted @ 2019-02-16 17:10  花拾夕  阅读(1161)  评论(0编辑  收藏  举报