Class ErrorProneValidator

java.lang.Object
com.qulice.errorprone.ErrorProneValidator
All Implemented Interfaces:
ResourceValidator

public final class ErrorProneValidator extends Object implements ResourceValidator
Validates source code with Google ErrorProne.

Runs the javac executable from the active JDK as a forked process, with ErrorProne wired in as a -Xplugin:ErrorProne so that every bug pattern fires while javac type-checks the project's Java sources. The --add-exports and --add-opens flags ErrorProne needs to reach internal jdk.compiler packages are passed to the forked JVM via javac's -J prefix; the JVM hosting Maven and Qulice is unaffected, so consumers do not have to touch their own .mvn/jvm.config to use this validator.

Diagnostics from the forked javac are parsed from the combined stdout/stderr stream. Only lines that match the standard compiler diagnostic format and whose message starts with the [CheckName] prefix ErrorProne always emits are converted into Violations — plain compile errors caused by the project not being built yet are ignored. -proc:none is passed to keep regular annotation processors (Lombok, Hibernate-Validator, etc.) out of the ErrorProne pass.

Since:
1.0