Spring Boot热部署-spring-boot-devtools

这个热部署很简单,添加spring-boot-devtools的依赖,然后修改build标签里的东西就可以了。

<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不会起作用 -->
                    <fork>true</fork>
                </configuration>
            </plugin>
        </plugins>
    </build>

用的时候跟spring loaded差不多,需要手动rebuild project

项目地址,其他的热部署方式可先忽略

猜你喜欢

转载自blog.csdn.net/qq_28056641/article/details/81292929