简体   繁体   English

Jenkins CI服务器中的Maven Project问题

[英]Issue with Maven Project in Jenkins CI server

Now we are trying to deploy maven project by using the Jenkins CI tool. 现在,我们正在尝试使用Jenkins CI工具部署Maven项目。

I have created a sample maven project and added the repository URL and credentials of my local repository then i have clicked on the Build Job . 我创建了一个示例maven项目,并添加了存储库URL和本地存储库的凭据,然后单击Build Job。 then Jenkins downloaded my code into the work space of the particular job and its downloaded all the dependencies but i got the following error in the Jenkins console output as shown in the below. 然后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

Can any one help me to resolve the issue 谁能帮我解决问题

Looks like it's searching for a oracle-specific library and you're using open jdk. 看起来它正在搜索特定于oracle的库,并且正在使用open jdk。 Switching to Oracle jdk will probably fix your issue. 切换到Oracle jdk可能会解决您的问题。

Install Oracle jdk in your Jenkins server and point JAVA_HOME/PATH variables to Oracle jdk. 在您的Jenkins服务器中安装Oracle jdk,并将JAVA_HOME / PATH变量指向Oracle jdk。

Check in cmd (or shell, depends on your OS) your java version 签入cmd(或shell,取决于您的操作系统)您的Java版本

java -version

and the path 和路径

echo %JAVA_HOME%

You're probably using jre instead of jdk. 您可能正在使用jre而不是jdk。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM