2015-08-20 34 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%