I downloaded the sources and tried to generate it locally.
If found it is not possible to use a JDK6 to compile due to other plugin compatibility:
[ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:1.117:validate (default-validate) on project throttle-concurrents: Execution default-validate of goal org.jenkins-ci.tools:maven-hpi-plugin:1.117:validate failed: Unable to load the mojo 'validate' in the plugin 'org.jenkins-ci.tools:maven-hpi-plugin:1.117' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/jenkinsci/maven/plugins/hpi/ValidateMojo : unsupported classversion 51.0
The problem lies in the pom.xml configuration. "compileSource" and "compileTarget" no longer work but "java.level" and "java.level.test". So pom.xml should be updated:
{{<!--
<compileSource>1.6</compileSource>
<compileTarget>1.6</compileTarget>
-->
<java.level>6</java.level>
<java.level.test>6</java.level.test>}}
There was another issue with xml-apis. It did not compile due to a missing class. I had to force a higher version:
{{ <dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
<scope>test</scope>
</dependency>}}
And finally one of the classes would now compile due to Java7 syntax:
[ERROR] /O:/oip/ws/oip/throttle-concurrent-builds-plugin-throttle-concurrents-1.9.0/src/test/java/hudson/plugins/throttleconcurrents/testutils/HtmlUnitHelper.java:[56,46] diamond operator is not supported in -source 1.6
Just replace following line (65) of HtmlUnitHelper.java :
List<HtmlButton> res = new ArrayList<>(buttons.size());
by
List<HtmlButton> res = new ArrayList<HtmlButton>(buttons.size());
And it works.
I downloaded the sources and tried to generate it locally.
If found it is not possible to use a JDK6 to compile due to other plugin compatibility:
[ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:1.117:validate (default-validate) on project throttle-concurrents: Execution default-validate of goal org.jenkins-ci.tools:maven-hpi-plugin:1.117:validate failed: Unable to load the mojo 'validate' in the plugin 'org.jenkins-ci.tools:maven-hpi-plugin:1.117' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/jenkinsci/maven/plugins/hpi/ValidateMojo : unsupported classversion 51.0
The problem lies in the pom.xml configuration. "compileSource" and "compileTarget" no longer work but "java.level" and "java.level.test". So pom.xml should be updated:
{{<!--
<compileSource>1.6</compileSource>
<compileTarget>1.6</compileTarget>
-->
<java.level>6</java.level>
<java.level.test>6</java.level.test>}}
There was another issue with xml-apis. It did not compile due to a missing class. I had to force a higher version:
{{ <dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
<scope>test</scope>
</dependency>}}
And finally one of the classes would now compile due to Java7 syntax:
[ERROR] /O:/oip/ws/oip/throttle-concurrent-builds-plugin-throttle-concurrents-1.9.0/src/test/java/hudson/plugins/throttleconcurrents/testutils/HtmlUnitHelper.java:[56,46] diamond operator is not supported in -source 1.6
Just replace following line (65) of HtmlUnitHelper.java :
List<HtmlButton> res = new ArrayList<>(buttons.size());
by
List<HtmlButton> res = new ArrayList<HtmlButton>(buttons.size());
And it works.