Unable to build Maven site with Java 8
Description
Environment
Activity
Tom Zeller June 1, 2016 at 5:20 PM
Resolving as completed, we can build the Maven site with Java 8 now, minus the Cobertura report.
Tom Zeller June 1, 2016 at 5:19 PM
Reopening.
Cobertura-maven-plugin 2.6+ seems to change the target artifact during instrumentation, so staying with 2.5.2. Because 2.5.2 throws errors with Java 8, the Cobertura report has been moved to a Java-7-only profile in the parent-v3 POM.
Tom Zeller May 10, 2016 at 10:18 PM
Upgraded cobertura-maven-plugin to 2.7.
Tom Zeller May 3, 2016 at 11:14 PM
Updating Cobertura to 2.7 seems to work now for both Java 7 and 8.
Tom Zeller April 26, 2016 at 12:11 AM
Turns out I inadvertently broke the generation of the Maven site using Java 8 when I disabled doclint by configuring the Javadoc reportPlugin only [1], a mechanism which turns out is deprecated/private [2].
Looks like
<profile>
<id>disable-javadoc-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
</profile>
should be replaced with
<profile>
<id>disable-javadoc-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
[2] https://maven.apache.org/plugins/maven-site-plugin/maven-3.html#Configuration_formats
With Java 8, 'mvn site' fails, probably because of Cobertura being out-of-date.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project java-support: failed to get report for org.codehaus.mojo:cobertura-maven-plugin: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test (default-test) on project java-support: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.16:test failed: There was an error in the forked process
[ERROR] org.testng.TestNGException:
[ERROR] An error occurred while instantiating class net.shibboleth.utilities.java.support.collection.CollectionTest: Expecting a stackmap frame at branch target 62
[ERROR] Exception Details:
[ERROR] Location:
[ERROR] net/shibboleth/utilities/java/support/logic/TransformAndCheckFunction.equals(Ljava/lang/Object;)Z @23: ifnonnull
[ERROR] Reason:
[ERROR] Expected stackmap frame at this location.
[ERROR] Bytecode:
[ERROR] 0x0000000: 033d 11ff ff3e 121d 1100 53b8 0023 2b11
My preference is to banish the site plugin, much like the maven-release-plugin.