GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — javac problem matcher does not annotate Maven compiler output (works for Gradle & plain javac) · Issue #1085 · actions/setup-java

javac problem matcher does not annotate Maven compiler output (works for Gradle & plain javac) #1085

New issue
Copy link
New issue
Copy link
Closed
#1086
Closed
javac problem matcher does not annotate Maven compiler output (works for Gradle & plain javac)#1085
#1086
Copy link
Labels
bugSomething isn't workingneeds triage

Description

@brunoborges
brunoborges
opened on Jul 8, 2026
Issue body actions

Description:

The javac problem matcher registered by setup-java (##[add-matcher] java.json) only annotates compiler output that is in javac's native diagnostic format:

File.java:12: warning|error: message

matched by the regex in .github/java.json (owner javac):

^([^:]+):(\d+): (warning|error): (.+?)$

This works for direct javac invocations and for Gradle builds (Gradle passes javac diagnostics through unchanged). It does not work for Maven builds. The maven-compiler-plugin reformats every diagnostic to:

[WARNING] /path/to/File.java:[12,5] message
[ERROR]   /path/to/File.java:[12,5] message

The leading [WARNING]/[ERROR] label and the :[line,col] syntax (comma-separated line/column in brackets, instead of :line:) mean the matcher regex never matches. As a result, Maven builds using setup-java report warnings and errors in the log but produce zero GitHub annotations, while functionally identical Gradle builds are fully annotated. This is a surprising inconsistency for the large share of the Java ecosystem that builds with Maven.

Task version:

v5.5.0 (also reproduces on the tip of main, commit 0f481fc).

Platform:

  • Ubuntu
  • macOS
  • Windows

(Not platform-specific — the matcher regex vs. Maven output format is identical on all runners; verified on Ubuntu.)

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Public repro with a self-verifying workflow that asserts the annotation counts for both build tools: actions/setup-java-v5.5-tests#2

Minimal steps:

  1. uses: actions/setup-java@v5 (registers the javac matcher).
  2. Build a project that emits a compiler warning or error with Maven, e.g. mvn -B compile on a class compiled with -Xlint:all.
  3. Observe the log contains [WARNING] .../File.java:[7,30] ... diagnostics.
  4. Open the run's Annotations panel.

For comparison, run the same warning/error sources through Gradle (./gradlew compileJava) in the same workflow.

Expected behavior:

Warnings and errors from a Maven build should be surfaced as GitHub annotations, the same way they are for direct javac and Gradle builds.

Actual behavior:

Maven builds produce no annotations. In the repro run, the Gradle job annotated 4 warnings + 2 errors, while the Maven job (reporting the same 4 warnings / 2 errors in its log) produced 0 annotations because none of the [WARNING] File.java:[l,c] msg lines match the javac matcher.

Suggested fix:

Add a second pattern to the javac owner in .github/java.json (or a new maven owner) that recognizes the Maven compiler plugin format, roughly:

^\[(?:WARNING|ERROR)\]\s+(.+?\.java):\[(\d+),(\d+)\]\s+(.+)$

capturing file / line / column / message. Keeping it under the same owner (or a distinct one that's also registered) would make Maven builds annotate consistently with Gradle and plain javac.

Activity

  1. brunoborges
    added
    bugSomething isn't working
    needs triage
    on Jul 8, 2026
  2. brunoborges commented on Jul 8, 2026

    @brunoborges
    brunoborges
    on Jul 8, 2026
    ContributorAuthor
    More actions

    A backport of the fix to the releases/v5 line has been opened in #1087 (the fix on main is #1086).

  3. brunoborges
    added 2 commits that reference this issue on Jul 8, 2026

    Add Maven compiler problem matcher for javac diagnostics (#1087)

    This issue will close once commit 62df799 is merged into the 'main' branch.
    62df799

    Add Maven compiler problem matcher for javac diagnostics (#1086)

    This issue will close once commit fe9b749 is merged into the 'main' branch.
    fe9b749
  4. brunoborges
    closed this as completedin #1086on Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.