Add Maven compiler problem matcher for javac diagnostics#1086
Merged
brunoborges merged 1 commit intoJul 8, 2026
Merged
Conversation
The javac problem matcher only recognized javac's native diagnostic format (File.java:12: warning: msg), which works for plain javac and Gradle but not Maven. The maven-compiler-plugin reformats diagnostics to [WARNING] /path/File.java:[12,5] msg, so Maven builds produced zero annotations. Add a new maven-javac matcher owner that recognizes the Maven format, capturing severity, file, line, column, and message. Maven builds now annotate consistently with Gradle and plain javac. Fixes: actions#1085 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Maven-specific javac diagnostic matching to actions/setup-java’s existing Java problem matcher so Maven compiler warnings/errors produce GitHub annotations (consistent with plain javac and Gradle).
Changes:
- Adds a new problem matcher owner (
maven-javac) that matchesmaven-compiler-plugin’s[WARNING]/[ERROR] /path/File.java:[line,col] messageformat. - Keeps existing
javaandjavacmatcher owners unchanged to preserve current behavior.
Show a summary per file
| File | Description |
|---|---|
| .github/java.json | Adds a maven-javac matcher pattern to recognize Maven compiler plugin diagnostics and enable annotations. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Low
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
The
javacproblem matcher registered bysetup-javaonly recognizes javac's native diagnostic format (File.java:12: warning: msg). That works for plainjavacand for Gradle (which passes diagnostics through unchanged), but not for Maven. Themaven-compiler-pluginreformats every diagnostic to[WARNING] /path/File.java:[12,5] msg, so the existing regex never matches and Maven builds produce zero GitHub annotations even though the warnings/errors appear in the log.This adds a new
maven-javacproblem matcher owner to.github/java.jsonthat recognizes the Maven format and captures severity, file, line, column, and message. A separate owner is used because multiple patterns under one owner are treated as a multiline sequence, not as alternatives. Both owners are registered by the same existing##[add-matcher]call, so no source change is needed. Maven builds now annotate consistently with Gradle and plain javac.Notes:
javaandjavacowners are unchanged, so current behavior is preserved.java.jsonis loaded at runtime by the runner and is not part of the webpack bundle, sodist/does not need regeneration.severityvalue case-insensitively, so capturing the uppercaseWARNING/ERRORlabels works.Related issue:
Fixes: #1085
Check list:
npm run checklocally (format, lint, build, test) and all checks pass.