2015-08-20 33 views
0

現在我們試圖通過使用Jenkins CI工具來部署maven項目。Jenkins CI服務器中Maven項目的問題

我已經創建了一個示例maven項目,並添加了本地存儲庫的存儲庫URL和憑證,然後我點擊了構建作業。 然後Jenkins將我的代碼下載到特定作業的工作空間中,並下載了所有依賴項,但在Jenkins控制檯輸出中出現以下錯誤,如下所示。

Downloaded: http://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar (61 KB at 31.6 KB/sec) 
Downloaded: http://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6.jar (228 KB at 74.4 KB/sec) 
Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar (425 KB at 42.2 KB/sec) 
Downloading: http://repo.bodar.com/com/googlecode/totallylazy/totallylazy/1.20/totallylazy-1.20.jar 
Downloaded: http://repo.bodar.com/com/googlecode/totallylazy/totallylazy/1.20/totallylazy-1.20.jar (949 KB at 718.8 KB/sec) 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 3:00.677s 
[INFO] Finished at: Thu Aug 20 01:44:31 IST 2015 
[INFO] Final Memory: 9M/22M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project gcrtesting: Could not resolve dependencies for project com.vidyayug.testing:gcrtesting:jar:0.0.1-SNAPSHOT: Could not find artifact com.sun:tools:jar:0 at specified path /usr/lib/jvm/java-7-openjdk-i386/jre/../lib/tools.jar -> [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/DependencyResolutionException 
[JENKINS] Archiving /var/lib/jenkins/workspace/Maven testing selenium/pom.xml to com.vidyayug.testing/gcrtesting/0.0.1-SNAPSHOT/gcrtesting-0.0.1-SNAPSHOT.pom 
channel stopped 
Finished: FAILURE 

任何一個可以幫助我解決這個問題

回答

0

看起來像它的搜索特定的Oracle庫,你正在使用JDK開放。切換到Oracle jdk可能會解決您的問題。

在您的Jenkins服務器中安裝Oracle jdk,並將JAVA_HOME/PATH變量指向Oracle jdk。

+0

謝謝阿米拉。當在jenkins中將特定工作添加到Oracle Java主目錄後,問題得到了解決,然後Maven構建 - 成功,但在我的Maven項目中有selenium腳本,用於自動化測試過程,同時通過Jenkins運行腳本,當時需要打開Firefox瀏覽器出現以下錯誤 ##運行se.thinkcode.itake.RunCukesTest 功能:MyGcr org.openqa.selenium.firefox.NotConnectedException:無法在45000 ms後連接到端口7055上的主機127.0.0.1。 Firefox控制檯輸出: –

0

入住CMD(或外殼,取決於您的操作系統),您的Java版本

java -version 

和你可能會使用JRE而不是JDK的路徑

echo %JAVA_HOME%