Is JDK7 available on buildhive.cloudbees.com - I don't see it anywhere in the config?
Asked
Active
Viewed 338 times
2 Answers
2
It seems this can be done with a Maven profile, use the following code in your pom.xml
and add:
-Pbuildhive clean install
as Maven goal in BuildHive.
<profile>
<id>buildhive</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<encoding>UTF-8</encoding>
<executable>/opt/jdk/jdk1.7.0/bin/javac</executable>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<jvm>/opt/jdk/jdk1.7.0/bin/java</jvm>
<forkMode>once</forkMode>
</configuration>
</plugin>
</plugins>
</build>
</profile>
-
Unfortunately this workaround would not satisfy the Enforcer plugin, as can be seen here: https://buildhive.cloudbees.com/view/My%20Repositories/job/jenkinsci/job/winstone/15/console – Jesse Glick Jan 22 '13 at 14:31
1
Yes it is available, even if not listed:
JDK 7 is located in: /opt/jdk/jdk1.7.0
Go to the project configuration page and in the "Shell Script" put JAVACMD=/opt/jdk/jdk1.7.0/bin/java ant tests -- for example

Michael Neale
- 19,248
- 19
- 77
- 109
-
1That does not help when you have a templatized job that does not allow specific configuration. For example https://buildhive.cloudbees.com/job/jenkinsci/job/winstone/configure does not have any place to set the JDK used to run Maven; and this job is in fact broken because it is run on JDK 6. – Jesse Glick Nov 14 '12 at 14:19
-
And why not make JDK 7 the default? You can easily use -source 6 and something like Animal Sniffer to build Java 6-based projects using JDK 7, but not the reverse. – Jesse Glick Nov 14 '12 at 14:20
-
-