Class ErrorProneValidator
- All Implemented Interfaces:
ResourceValidator
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionname()Name of this validator.validate(Collection<File> files) Validate and throws exception if there are any problems.
-
Constructor Details
-
ErrorProneValidator
Constructor.- Parameters:
env- Environment to use
-
-
Method Details
-
validate
Description copied from interface:ResourceValidatorValidate and throws exception if there are any problems.- Specified by:
validatein interfaceResourceValidator- Parameters:
files- Files to validate- Returns:
- Validation results
-
name
Description copied from interface:ResourceValidatorName of this validator.- Specified by:
namein interfaceResourceValidator- Returns:
- Name of this validator
-