spring-boot-devtools熱部署配置
阿新 • • 發佈:2018-12-21
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關閉 否則熱部署會失敗