Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[MCOMPILER-435] Plugin does not report actual error from ErrorProne when toolchain is used

Open
#658 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
build-system

Research direction

Start with the attached sample project and run ./mvnw clean install, then ./mvnw -Puse-toolchain clean install using JDK 11. Compare how the compiler plugin reports ErrorProne's InvalidCommandLineOptionException with and without the toolchain, and verify that the toolchain case exposes the actual error rather than only "Compilation failure."

Written by the indexing model from the issue text.

Description

bug priority:critical

Rocher Suchard opened MCOMPILER-435 and commented

Hello,

I followed ErrorProne installation (http://errorprone.info/docs/installation and http://errorprone.info/docs/patching) but I did not provide a -XepPatchCheck which result in an error that maven-compiler-plugin fails to report when a toolchain is used:

Without a toolchain, I get this error which is what I expect, eg: something that helps!

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on
 project maven-compiler-plugin-error-prone: Fatal error compiling: -XepPatchChecks and -XepPatchLocation must be specif
ied together -> [Help 1]

With a JDK 11 toolchain, the error won't help, neither the (huge) stacktrace when using -e.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on
 project maven-compiler-plugin-error-prone: Compilation failure -> [Help 1]

maven-compiler-plugin is unable to report correctly the com.google.errorprone.InvalidCommandLineOptionException thrown by ErrorProne when a toolchain is used (in this case, the toolchain is useless, but I have profile with Java 15).

The attached file contains a sample project:

  • To test the case when it reports the ErrorProne exception, simply do ./mvnw clean install
  • To test the case with a JDK 11 toolchain, simply do ./mvnw -Puse-toolchain clean install

Java 11 is both required to build, and as a toolchain.


Affects: 3.8.1

Attachments:

Dominant language
Java
Stars
261
Forks
194
Avg merge
1d 5h
Merged PRs (30d)
17

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-compiler-plugin

All issues in apache/maven-compiler-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.