在jenkins裏maven使用cargo部署失敗

cargo確實是自動部署tomcat的利器,詳細可見我之前的文章:
使用cargo實現jenkins自動部署遠程tomcat

但是發現卻不是那麼穩定。主要體現在偶爾會使得jenkins構建失敗。

錯誤主要有三種:
1

FAIL - The application [/zsale-web] is already being serviced

2

Connection refused -> [Help 1]

3

FAIL - Context /zsale-web is defined in server.xml and may not be undeployed -> [Help 1]

雖然是三種不同的錯誤信息,但現象相似,此時一般tomcat也訪問不了,需要重啓tomcat才修復。

這樣對開發人員造成了極大的困擾,因爲明明我提交的代碼並沒有問題,但是卻通知我構建失敗。

估計是因爲cargo使用tomcat熱部署,而熱部署本身就不是很穩定,最終我還是使用傳統的停tomcat,部署工程,啓tomcat這一套解決(自己寫shell腳本)。也就是說放棄使用cargo了(在jenkins中把cargo:redeploy去掉)。如有知道怎麼更好解決的麻煩也告訴我一下,謝謝。
這裏寫圖片描述

昨天完整的報錯信息:

[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 27.633 s
[INFO] Finished at: 2015-09-19T21:00:41+08:00
[INFO] Final Memory: 56M/875M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.15:redeploy (default-cli) on project zsale-web: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.15:redeploy failed: Failed to redeploy [http://30.1.23.250:8080/job/zsale/ws/target/zsale-web-0.0.1-SNAPSHOT.war]: Connection refused -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[JENKINS] Archiving http://30.1.23.250:8080/job/zsale/ws/pom.xml to com.asiainfo/zsale-web/0.0.1-SNAPSHOT/zsale-web-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving http://30.1.23.250:8080/job/zsale/ws/target/zsale-web-0.0.1-SNAPSHOT.war to com.asiainfo/zsale-web/0.0.1-SNAPSHOT/zsale-web-0.0.1-SNAPSHOT.war
channel stopped
這裏寫圖片描述

轉載請標明出處:
本文出自:【ouyida3的博客
2015.9.20

發佈了205 篇原創文章 · 獲贊 38 · 訪問量 47萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章