From 911dbbb1a9308648c2d589772fdeba9c57ef1a5f Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Sat, 8 Sep 2018 14:23:34 +0200 Subject: [PATCH 1/3] Support Error Prone on Java 8-11 The previous Error Prone setup only properly worked on Java 8 and 9. By configuring Error Prone as a javac plugin it now also successfully runs on Java 10 and above. Running the plugin under Java 8 requires a modest amount of extra configuration. While there: - Enable the `ConstructorLeaksThis` check now that the bug that was filed against it is fixed. - Drop the `-Xlint:-processing` flag because it seems the code now compiles fine without it. --- .travis.yml | 3 +- pom.xml | 120 +++++++++++++++++++++++++++++++++------------------- 2 files changed, 78 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a1401a..2a871e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,7 @@ matrix: - jdk: openjdk8 script: ./mvnw install - jdk: openjdk11 - # XXX: Error Prone is not yet compatible with JDK 11. - script: ./mvnw install -Dverification.skip + script: ./mvnw install addons: sonarcloud: organization: picnic-technologies diff --git a/pom.xml b/pom.xml index 7331482..323e7d5 100644 --- a/pom.xml +++ b/pom.xml @@ -75,12 +75,12 @@ UTF-8 2.3.1 + 9+181-r4173-1 1.0 3.0.1 1.8 3.5.3 0.6.3 - 2.8.5 2.22.0 + + com.google.errorprone + error_prone_core + ${version.error-prone} + com.google.guava guava 27.0-jre + com.google.guava guava-beta-checker ${version.guava-beta-checker} + com.uber.nullaway nullaway @@ -702,6 +713,34 @@ + + + jdk8 + + 1.8 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + true + + -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${version.error-prone-javac}/javac-${version.error-prone-javac}.jar + + + + + + + @@ -772,6 +811,11 @@ + + com.google.errorprone + error_prone_core + ${version.error-prone} + com.google.guava guava-beta-checker @@ -787,52 +831,35 @@ - -Xdoclint:all - -Xdoclint:missing/protected + -Xdoclint:all,-missing/package -Xlint:all - - -Xlint:-processing - - -XepAllDisabledChecksAsWarnings - - -Xep:ConstructorLeaksThis:OFF - - -Xep:FieldMissingNullable:OFF - -XepOpt:NullAway:AnnotatedPackages=tech.picnic + + + + -Xplugin:ErrorProne -XepAllDisabledChecksAsWarnings -Xep:FieldMissingNullable:OFF -XepOpt:NullAway:AnnotatedPackages=tech.picnic + + + -XDcompilePolicy=simple - javac-with-errorprone - true true - - - com.google.errorprone - error_prone_core - ${version.error-prone} - - - org.codehaus.plexus - plexus-compiler-api - ${version.plexus-compiler} - - - org.codehaus.plexus - plexus-compiler-javac - ${version.plexus-compiler} - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - ${version.plexus-compiler} - - org.apache.maven.plugins @@ -899,6 +926,13 @@ org.apache.maven.plugins maven-compiler-plugin + + + -Xlint:-options + true From e7e4a8cfec6f37c0694a6cd9aa366fe7928409d9 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Sat, 15 Sep 2018 15:14:25 +0200 Subject: [PATCH 2/3] Only fork when necessary And move flags that only have an impact when forking to the relevant location. --- pom.xml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 323e7d5..ec0b1ab 100644 --- a/pom.xml +++ b/pom.xml @@ -421,13 +421,6 @@ maven-compiler-plugin 3.8.0 - - - - 256m true ${version.jdk} ${version.jdk} @@ -723,6 +716,9 @@ jdk8 1.8 + + !verification.skip + @@ -731,10 +727,12 @@ org.apache.maven.plugins maven-compiler-plugin - true + -J-XX:TieredStopAtLevel=1 -J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${version.error-prone-javac}/javac-${version.error-prone-javac}.jar + true + 256m From c0680f943929516f822fecfedaad741546c0a5b4 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Mon, 19 Nov 2018 11:55:00 +0100 Subject: [PATCH 3/3] Document a technicality --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ec0b1ab..83e92ba 100644 --- a/pom.xml +++ b/pom.xml @@ -626,7 +626,7 @@ org.eluder.coveralls coveralls-maven-plugin 4.3.0 -