1) I created new job of type "Build a maven2/3 project".
Build on Jenkins fails requiring tools:jar:1.5.0, but this project uses Java SE 6 (that is java 1.6)
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact com.sun:tools:jar:1.5.0 at specified path D:\Jenkins\jre/../lib/tools.jar
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:260)
... 34 more
I am using latest versions: jenkins 1.421, maven 3.0.3
update: Maven pom says to use 1.6. There's no trace of intention to use 1.5
开发者_开发问答<plugin> <!-- http://maven.apache.org/plugins/maven-compiler-plugin/ -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
2) Finally I tried to create new job of type "Build a free-style software project". It works, no this error. Up to the maven package phase. This however requires more configuration, that I right now don't know. And I can't get packaged result on jenkins page.
update: Solved! Needed to add JDK (the same as JAVA_HOME) in Jenkins configuration
You trying to run the build under a 1.5 JRE instead of JDK which is required by Maven to run. You need a 1.5 JDK and not only a JRE!
精彩评论