spring-boot-devtools热部署配置

pom.xml文件添加配置信息
1.添加依赖包

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

2.添加spring-boot-maven-plugin

<build>
	<plugins>
	    <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
          		<!--fork :  如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
                <fork>true</fork>
            </configuration>
        </plugin>
	</plugins>
</build>

即可完成springboot热部署
注意不要将build automaticautomatically关闭 否则热部署会失败

猜你喜欢

转载自blog.csdn.net/qq_42019139/article/details/85044830