一、熱啟動:
每自修改后, 程序自動啟動spring Application上下文。
Pom中直接添加依賴即可:
1
2
3
4
5
|
< dependency > < groupId >org.springframework.boot</ groupId > < artifactId >spring-boot-devtools</ artifactId > < optional >true</ optional > </ dependency > |
這里需要注意的是每次類文件更改后需要重新編譯方可觸發服務重新啟動
二、熱交換或熱部署
這個使用springloaded插件。
1.添加依賴:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
< build > < plugins > < plugin > < groupId >org.springframework.boot</ groupId > < artifactId >spring-boot-maven-plugin</ artifactId > < dependencies > <!-- spring熱部署 --> < dependency > < groupId >org.springframework</ groupId > < artifactId >springloaded</ artifactId > < version >1.2.6.RELEASE</ version > </ dependency > </ dependencies > </ plugin > </ plugins > </ build > |
如果是使用spring-boot:run的話,那么到此配置結束
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。
原文鏈接:http://blog.csdn.net/u013030980/article/details/53695287