Skip to content

Commit

Permalink
[pom] Add in work to get cobertura at least working with java 8
Browse files Browse the repository at this point in the history
note: asm throws errors no matter what and likely since java 8 changed enough that it should have been different versions over the years at least 2 or 3 times.  The build though does at least work without failing for it now.
  • Loading branch information
hazendaz committed Dec 19, 2023
1 parent 6c6f096 commit 3f5da44
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,57 @@
<profiles>
<profile>
<id>cobertura</id>
<properties>
<!-- Allow jdk 8 as cobertura won't work otherwise -->
<allowed.build.jdks>[8,9),[11,12),[17,18),[21,22),[22,23)</allowed.build.jdks>
<!-- Disable release flags for java 8 -->
<maven.compiler.release />
<maven.compiler.testRelease />
<!-- Force error prone to java 8 copy -->
<error-prone.version>2.10.0</error-prone.version>
<javac.version>9+181-r4173-1</javac.version>
</properties>
<build>
<plugins>
<!-- Skip git commit id plugin as it requires jdk 11 or higher -->
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<executions>
<execution>
<id>git-commit-id</id>
<goals>
<goal>revision</goal>
</goals>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!-- Making error prone work again with java 8 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
<compilerArgs combine.children="append">
<arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${maven.cobertura.version}</version>
<dependencies>
<!-- Attempted hack to get over tools issue did not work out -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>0</version>
<scope>system</scope>
<systemPath>${project.basedir}/pom.xml</systemPath>
</dependency>
<!-- Trying to force at least somewhat newer asm (code is stuck on 5 and gets errors regardless) -->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
Expand Down

0 comments on commit 3f5da44

Please sign in to comment.