Eclipse Spring boot項目熱部署

來源:互聯網
上載者:User

標籤:restart   img   分享圖片   整合   ima   常用   cli   項目   framework   

spring boot項目 熱部署

一,參考文檔:springboot 熱部署

note:

1.使用eclipse: project-->Build Automatically (選中) 

2.Digital Twin 項目使用Spring boot 版本為:1.2.3.RELEASE,使用spring-boot-devtools無效. 查看Spring-boot-devtools,最低版本為1.3.0. 猜測Spring boot 整合Spring-boot-devtools最低版本為1.3.03.把SpringLoaded放入spring-boot-maven-plugin中,會導致連接埠佔用,需要用控制台關閉java程式,所有不推薦

二.3種方式的使用

1.使用springloaded 放入spring-boot-maven-plugin中(連接埠會被佔用,不推薦)

在pom檔案添加依賴

<build> <plugins> <plugin>  <groupId>org.springframework.boot</groupId>  <artifactId>spring-boot-maven-plugin</artifactId>  <dependencies>   <dependency>    <groupId>org.springframework</groupId>    <artifactId>springloaded</artifactId>    <version>1.2.6.RELEASE</version>   </dependency>  </dependencies> </plugin> </plugins></build>

2.spring-boot-devtools(Springboot 版本為1.3.0以上,推薦)

添加pom檔案依賴

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <!-- 這個需要為 true 熱部署才有效 --></dependency>

如果我們想指定讓 devtools 監聽指定檔案夾,那麼可以在 application.yml 配置

spring.devtools.restart.additional-paths=your path

3.使用springloaded ,下載springloaded常用版本(如:springloaded-1.2.3.RELEASE.jar)放入指定路徑下(推薦)

啟動項目:Application檔案-->run as--> Run configurations...-->Arguments-->VM arguments     -javaagent:D:/javasoft/springloaded-1.2.3.RELEASE.jar  -noverify

Eclipse Spring boot項目熱部署

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.