Skip to content
Latchkey

Maven Error Prone "error: [<Check>]" Compile Failure - Fix in CI

Error Prone runs inside javac as an annotation-processor-style compiler plugin and promotes bug patterns to errors. A flagged pattern (e.g. [MissingOverride], [EqualsHashCode]) becomes a compile error and fails the build.

What this error means

Compilation fails with error: [<CheckName>] <message> at a file and line, even though the code is valid Java. The Error Prone check name in brackets identifies the bug pattern, not a syntax error.

mvn output
[ERROR] /src/main/java/com/example/Cache.java:[31,5] error: [MissingOverride]
  expected @Override because this method overrides a method in a supertype
    public boolean equals(Object o) {
[ERROR] Failed to execute goal ...:compile (default-compile): Compilation failure

Common causes

A bug pattern flagged as an error

Error Prone detected a likely mistake (missing @Override, an equals without hashCode, a format-string mismatch) and, at error severity, fails the compile.

A new check or stricter severity

Upgrading Error Prone or raising a check’s severity surfaces patterns in existing code that previously compiled.

How to fix it

Fix the flagged pattern

The bracketed check name and message describe the real fix - usually a one-line correction.

Java
// [MissingOverride] - add the annotation
@Override
public boolean equals(Object o) { ... }

Demote a check deliberately if it is a false positive

Lower a specific check’s severity via the compiler args rather than disabling Error Prone wholesale.

pom.xml (compiler)
<compilerArgs>
  <arg>-Xplugin:ErrorProne -Xep:MissingOverride:WARN</arg>
</compilerArgs>

How to prevent it

  • Run Error Prone on every PR so patterns surface before merge.
  • Pin the Error Prone version so the active checks are stable.
  • Demote individual checks deliberately, not the whole plugin.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →