Jenkins CI服务器中的Maven项目问题

时间:2015-08-20 12:22:26

标签: java maven jenkins

现在我们正尝试使用Jenkins CI工具部署maven项目。

我创建了一个示例maven项目并添加了我的本地存储库的存储库URL和凭据,然后我点击了Build Job。 然后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

任何人都可以帮我解决问题

2 个答案:

答案 0 :(得分:0)

看起来它正在搜索特定于oracle的库,而你正在使用open jdk。切换到Oracle jdk可能会解决您的问题。

在Jenkins服务器中安装Oracle jdk并将JAVA_HOME / PATH变量指向Oracle jdk。

答案 1 :(得分:0)

签入cmd(或shell,取决于您的操作系统)您的Java版本

java -version

和路径

echo %JAVA_HOME%

您可能使用jre而不是jdk。