简体   繁体   中英

Issue with Maven Project in Jenkins CI server

Now we are trying to deploy maven project by using the Jenkins CI tool.

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 . 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.

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. Switching to Oracle jdk will probably fix your issue.

Install Oracle jdk in your Jenkins server and point JAVA_HOME/PATH variables to Oracle jdk.

Check in cmd (or shell, depends on your OS) your java version

java -version

and the path

echo %JAVA_HOME%

You're probably using jre instead of jdk.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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