-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
MOE_MIGRATED_REVID=209507984
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,57 +20,75 @@ | |
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>maven-plugin-example</artifactId> | ||
<artifactId>errorprone-example</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<!-- Turn on Error Prone --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.3</version> | ||
<configuration> | ||
<compilerId>javac-with-errorprone</compilerId> | ||
<forceJavacCompilerUse>true</forceJavacCompilerUse> | ||
<!-- maven-compiler-plugin defaults to targeting Java 5, but our | ||
javac only supports >=6 --> | ||
<source>8</source> | ||
<target>8</target> | ||
<showWarnings>true</showWarnings> | ||
</configuration> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.plexus</groupId> | ||
<artifactId>plexus-compiler-javac-errorprone</artifactId> | ||
<version>2.8</version> | ||
</dependency> | ||
<!-- override plexus-compiler-javac-errorprone's dependency on | ||
Error Prone with the latest version --> | ||
<dependency> | ||
<groupId>com.google.errorprone</groupId> | ||
<artifactId>error_prone_core</artifactId> | ||
<version>2.3.2-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<javac.version>9+181-r4173-1</javac.version> | ||
</properties> | ||
|
||
<profiles> | ||
<profile> | ||
<id>fixerrors</id> | ||
<id>jdk8</id> | ||
<activation> | ||
<jdk>1.8</jdk> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
<configuration> | ||
<compilerArgs combine.children="append"> | ||
<compilerArg>-XepPatchLocation:${basedir}</compilerArg> | ||
<compilerArg>-XepPatchChecks:DeadException,GetClassOnClass</compilerArg> | ||
<forceJavacCompilerUse>true</forceJavacCompilerUse> | ||
<fork>true</fork> | ||
<source>8</source> | ||
<target>8</target> | ||
<compilerArgs> | ||
<arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg> | ||
<arg>-XDcompilePolicy=simple</arg> | ||
<arg>-Xplugin:ErrorProne</arg> | ||
</compilerArgs> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>com.google.errorprone</groupId> | ||
<artifactId>error_prone_core</artifactId> | ||
<version>2.3.2-SNAPSHOT</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>jdk9</id> | ||
<activation> | ||
<jdk>[9,)</jdk> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
<configuration> | ||
<forceJavacCompilerUse>true</forceJavacCompilerUse> | ||
<fork>true</fork> | ||
<source>8</source> | ||
<target>8</target> | ||
<compilerArgs> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cushon
Author
Collaborator
|
||
<arg>-XDcompilePolicy=simple</arg> | ||
<arg>-Xplugin:ErrorProne</arg> | ||
</compilerArgs> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>com.google.errorprone</groupId> | ||
<artifactId>error_prone_core</artifactId> | ||
<version>2.3.2-SNAPSHOT</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/usr/local/google/home/cushon/src/error-prone/examples/maven/src/main/java/SomethingElse.java | ||
/usr/local/google/home/cushon/src/error-prone/examples/maven/src/main/java/Main.java |
Instead of duplicating everything, you can put the jdk9 configuration outside profile, and only use a jdk8 profile to add the bootclasspath entry (using the
combine.children="append"
attribute on thecompilerArgs
to merge the lists)