Repository navigation
Add Maven compiler problem matcher for javac diagnostics - #1086
Merged
brunoborges merged 1 commit intoJul 8, 2026
Merged
brunoborges merged 1 commit into
brunoborges merged 1 commit into
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
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.