Catch common Java mistakes as compile-time errors
Our documentation for users is at http://errorprone.info
Add the following configuration to your pom.xml
.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<compilerId>javac-with-errorprone</compilerId>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac-errorprone</artifactId>
<version>2.5</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Download the latest release of error-prone
from maven, and add the following javac task in your build.xml
.
<javac destdir="build"
compiler="com.google.errorprone.ErrorProneAntCompilerAdapter"
encoding="UTF-8" debug="true"
includeantruntime="false">
<src path="src"/>
<compilerclasspath>
<pathelement location="./path/to/error_prone_ant.jar"/>
</compilerclasspath>
</javac>
See examples/ant
for alternate ant configurations.
The gradle plugin is an external contribution. The documentation and code is at tbroyer/gradle-errorprone-plugin
To develop and build error-prone, see our documentation on the wiki.
- Mailing lists
- Javadoc
- Pre-release snapshots are available from Sonatype's snapshot repository.