Skip to content

Commit

Permalink
Disable error prone on Java 11 and below.
Browse files Browse the repository at this point in the history
  • Loading branch information
bramp committed Mar 11, 2024
1 parent a9901ab commit 693b882
Showing 1 changed file with 40 additions and 18 deletions.
58 changes: 40 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -327,29 +327,12 @@
<showWarnings>true</showWarnings>
<failOnError>true</failOnError>
<failOnWarning>true</failOnWarning>
<fork>true</fork>
<compilerArgs>
<!-- Surpress maven option warnings because we are
focusing on code issues -->
<arg>-Xlint:-options</arg>
<arg>-Xlint:all</arg>

<!-- Various flags needed for com.google.errorprone-->
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.25.0</version>
</path>
<!-- Other annotation processors go here.
If 'annotationProcessorPaths' is set, processors will no longer be
discovered on the regular -classpath; see also 'Using Error Prone
together with other annotation processors' below. -->
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -735,8 +718,8 @@
</dependency>
</dependencies>
</dependencyManagement>

</profile>

<profile>
<id>Java 9+</id>
<activation>
Expand All @@ -746,9 +729,47 @@
<!-- This flag was added from 9+ -->
<maven.compiler.release>${base.java.version}</maven.compiler.release>
</properties>
</profile>

<profile>
<id>Java 11+</id>
<activation>
<jdk>[11,)</jdk>
</activation>
<properties>
<!-- This flag was added from 9+ -->
<maven.compiler.release>${base.java.version}</maven.compiler.release>
</properties>
<build>
<pluginManagement>
<plugins>
<!-- Enable errorprone's compiler integration on Java 11
as that's the min supported version now -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
<compilerArgs combine.children="append">
<!-- Various flags needed for com.google.errorprone-->
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
</compilerArgs>
<annotationProcessorPaths>
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.25.0</version>
</path>
<!-- Other annotation processors go here.
If 'annotationProcessorPaths' is set, processors will no longer be
discovered on the regular -classpath; see also 'Using Error Prone
together with other annotation processors' below. -->
</annotationProcessorPaths>
</configuration>
</plugin>
<!-- Add formatting to Java 11+ -->
<plugin>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
Expand All @@ -763,6 +784,7 @@
</pluginManagement>
</build>
</profile>

<profile>
<id>Java 16+</id>
<activation>
Expand Down

0 comments on commit 693b882

Please sign in to comment.