Fix #12571: Build Report Foundation — structured report, console modes, warning control - #12572
Draft
gnodet wants to merge 2 commits into
Draft
Fix #12571: Build Report Foundation — structured report, console modes, warning control#12572gnodet wants to merge 2 commits into
gnodet wants to merge 2 commits into
Conversation
3 tasks
gnodet
force-pushed
the
feature/12571-build-report
branch
3 times, most recently
from
July 29, 2026 07:56
0d88607 to
bda1ea0
Compare
…s, warning control Adds a structured BuildReport data model (BuildReport → ModuleReport → MojoReport) with JSON persistence to target/build-report.json, a DiagnosticCollector for deduplicated warning summaries, four --console modes (plain, rich, machine, verbose), a --warning-mode CLI flag, automatic Log.warn() interception for Maven 3 plugins, and per-key diagnostic suppression via -Dmaven.diagnostic.suppress. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
force-pushed
the
feature/12571-build-report
branch
from
July 29, 2026 08:42
bda1ea0 to
2f33c5f
Compare
Replace the raw String parameter in BuildEventListener.projectLogMessage() with a structured LogEvent that carries level, logger name, clean message, formatted output, and stack trace. This enables console renderers to filter by log level — rich mode now suppresses INFO during the build and only shows WARN/ERROR. Key changes: - Add formattedMessage() to LogEvent API for pre-formatted console output - Replace Consumer<String> logSink with structured LogSink interface in MavenSimpleLogger, carrying level/loggerName/cleanMessage/formatted/throwable - Add context-aware write() overload in MavenBaseLogger to pass level context - ProjectBuildLogAppender creates LogEvent objects from the structured sink - Rich mode filters INFO/DEBUG/TRACE in projectLogMessage() - Machine mode emits level and logger fields in JSON output - Verbose/plain modes use formattedMessage() for backward-compatible output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Implements the build output overhaul proposed in #12571: a structured
BuildReportdata model with JSON persistence, aDiagnosticCollectorfor deduplicated warning summaries, four--consolemodes (plain,rich,machine,verbose), a--warning-modeCLI flag, automaticLog.warn()interception for Maven 3 plugin warnings, and per-key diagnostic suppression.What's included
Structured Build Report
BuildReport→ModuleReport→MojoReportdata model inmaven-api-corewithid()andfindModule()/findMojo()lookup methodsLogEventFailureReportwith timestamp, exception type, and stack traceBuildReportCollector(EventSpy,@Named @Singleton) — captures lifecycle eventsBuildReportJsonWriter— hand-written JSON serializer (no library dependency)target/build-report.jsonat session endorg.apache.maven.api.build.reportsub-packageDiagnosticCollector + Warning Summary
Diagnostic/DiagnosticCollector/DiagnosticSummaryAPIDefaultDiagnosticCollector— thread-safe (ConcurrentHashMap+LongAdder), dedup by key, capped at 1000build-report.jsonConsole Modes (
--console)--console=auto(default)plain; TTY →rich; otherwise →verbose--console=plain--console=rich--console=verbose--console=machinePlain mode: compact footer, no ANSI control sequences.
Rich mode: live
Statusbar showing active modules,[n/total]progress, elapsed time, download progress. Falls back gracefully on dumb terminals.Machine mode: one JSON object per line with typed
"event"field and ISO-8601 timestamps. Events:build.started/finished,module.started/succeeded/failed/skipped,mojo.*,fork.*,transfer.*.Warning Mode, Log Interception, Diagnostic Suppression
--warning-mode=summary(default)--warning-mode=all--warning-mode=none--warning-mode=failDiagnosticCollectorvia synthetic dedup keys (auto:<LoggerSuffix>:<hexHash>), with file-coordinate stripping so the same warning from different files deduplicates-Dmaven.diagnostic.suppress=<key>— suppress diagnostics by exact key or prefix wildcard (auto:*)What's NOT included (separate work)
Diagnosticobjects)mvn build-report:showpluginTests
91 unit tests across 10 test classes covering report assembly, JSON serialization, diagnostic dedup/suppression/concurrency, all console modes, and all warning modes. Integration tests that assert on verbose log output explicitly set
--console=verboseto work correctly under CI auto-detection.