Error Prone is a Java code checker developed by Google. In comparison to other code checkers like PMD and FindBugs, it excels at identifying more concise, hard-to-notice bugs. It is actively developed and has a wide list of rules.
Initially, I thought that adding this checker to an existing legacy project would be a trivial task. However, surprisingly, just adding a Gradle plugin didn't work. Therefore, I integrated it directly into the Gradle build file. In this article, I'll show you how to add Error Prone to your Java 8 project. For a quick summary, refer to the TLDR section.
Our project is a monolith code base with more than 100 sub-projects and almost 500K lines of code, all written in Java 8. The code is built using Java 8 JVM and Gradle 7.4.1.
The recommended way of using Error Prone plugin with Gradle project didn't work for me. So I had to integrate it directly into our Gradle build file. Thankfully, just by reading the plugin code and referring to other examples on GitHub made task task much easier for me.