1

Is JDK7 available on buildhive.cloudbees.com - I don't see it anywhere in the config?

Michael Neale
  • 19,248
  • 19
  • 77
  • 109

2 Answers2

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>
andr
  • 15,970
  • 10
  • 45
  • 59
Danny02
  • 52
  • 4
  • 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
  • 1
    That 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
  • yeah I think JDK7 should be the default. – Michael Neale Nov 16 '12 at 02:25
  • JDK7 will shortly be the default – Michael Neale Feb 18 '13 at 21:56