Skip to content

Commit

Permalink
Add google error-prone in compile step. (#223)
Browse files Browse the repository at this point in the history
* Add google error-prone in compile step.
  Note that FallThrough violations have been reduced to warnings. See issue #222
* Enable error-prone in the java 8 profile only, because the plugin was compiled for java 8, and cannot be used in openjdk7.
  • Loading branch information
regisd authored Nov 3, 2017
1 parent 846d20c commit ad1ab52
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,41 @@
</build>
<profiles>
<profile>
<!-- Profile for Java 8: Disable Doclint -->
<!-- Profile for Java 8: Enable error-prone, Disable Doclint -->
<id>java8</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<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>
<compilerArgs>
<arg>-Xep:FallThrough:WARN</arg>
</compilerArgs>
<source>7</source>
<target>7</target>
</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.1.1</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down

0 comments on commit ad1ab52

Please sign in to comment.