Skip to content

Build report: structured JSON report with per-mojo log capture - #12695

Closed
gnodet wants to merge 5 commits into
feature/logging-foundationfrom
feature/build-report
Closed

gnodet wants to merge 5 commits into
feature/logging-foundationfrom
feature/build-report

Conversation

@gnodet

@gnodet gnodet commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

Maven builds currently produce only console output — there is no machine-readable artifact capturing the result of a build. Tools (CI systems, IDEs, LLM agents) that need to know what succeeded, what failed, how long each module took, or what warnings were emitted must parse raw log text, which is fragile and tightly coupled to Maven's output format.

What

Introduces a structured JSON build report written to target/build-report-<timestamp>.json (with a build-report-latest.json symlink) at the end of every build. The report captures:

  • Overall build status (SUCCESS / FAILURE / SKIPPED), duration, start time, Maven and Java versions, goals
  • Per-module results (ModuleReport): status, timing, per-mojo execution results (MojoReport)
  • Per-mojo and per-module structured log events (LogEvent) with level, timestamp, logger name, source class/method, and thread ID — partitioned so that BuildReport.output(), ModuleReport.output(), and MojoReport.output() form a non-overlapping partition of the full build log
  • Failures with exception type, message, stack trace, and module/mojo attribution
  • Structured build problems (BuilderProblem) with deduplication key, suggestion, and documentation URL

New public API in maven-api-core (@Experimental):

  • org.apache.maven.api.build.report: BuildReport, ModuleReport, MojoReport, FailureReport, LogEvent, LogLevel, BuildStatus

Also promotes Log.trace() / Log.isTraceEnabled() / Log.child() from default-with-no-op to abstract methods, since the logging foundation (built in #12694) now provides full implementations.

⚠️ This PR is stacked on #12694 (logging foundation) and #13542 (BuildInvocation API). Review only the top commit.

How

  • BuildReportCollector — a @Named @Singleton EventSpy that hooks into the build lifecycle via AbstractEventSpy. No wiring changes needed; it is discovered automatically by the DI container.
  • Thread-based log routing: a ConcurrentHashMap<threadId → scope key> tracks which mojo or module is executing on each thread, so log events from parallel builds are attributed to the correct scope.
  • The --console=machine mode adds MachineBuildEventListener + MachineExecutionEventLogger, which emit one JSON object per line (JSON lines) to stdout — designed for real-time consumption by external tools.
  • ExecutionEventLogger is simplified: the grouped reactor summary (failures first, then successes) is replaced with a linear in-order summary that prints ... for skipped modules; failure/success lines are both emitted at INFO level with ANSI colour applied by the message builder. Maven and Java version are printed on failure to aid bug reports (MNG-7372).
  • Report files are written atomically (temp file + Files.move) to prevent partial reads.
  • jul-to-slf4j and logback-classic optional dependencies are removed from apache-maven and impl/maven-cli — the native JUL handler introduced in Logging foundation: structured LogEvent, JUL handler, Log API enhancements #12694 replaces the bridge.

PR chain

# PR Feature
0 #12929 Forward-port of 4.0.x Log API enhancements
0b #13542 BuildInvocation API
1 #12694 Logging foundation
2 This PR Build report
3 #13180 Console modes
4 #12698 Warning mode + diagnostics
5 #12699 mvnlog viewer
6 #12702 Structured problems pipeline
7 #12714 TRACE level migration

@gnodet
gnodet force-pushed the feature/logging-foundation branch from bae1db9 to 5a5af1e Compare August 8, 2026 01:19
@gnodet
gnodet force-pushed the feature/build-report branch from 602fffb to 056dcf0 Compare August 8, 2026 01:23
gnodet added a commit that referenced this pull request Aug 8, 2026
Add the --console CLI flag with four output modes:
- plain: compact one-line-per-module output for CI
- rich: JLine status bar with live reactor progress
- verbose: full mojo-level output (current default)
- machine: JSON lines for piping to external tools

Part 3 of the #12572 split (depends on build report PR #12695).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@gnodet
gnodet force-pushed the feature/build-report branch from 056dcf0 to a1ee585 Compare August 8, 2026 05:35
@gnodet
gnodet force-pushed the feature/logging-foundation branch from e64db31 to de8044a Compare August 8, 2026 12:14
@gnodet
gnodet force-pushed the feature/build-report branch from a1ee585 to 0f31ce2 Compare August 8, 2026 12:14
gnodet added a commit that referenced this pull request Aug 8, 2026
Add the --console CLI flag with four output modes:
- plain: compact one-line-per-module output for CI
- rich: JLine status bar with live reactor progress
- verbose: full mojo-level output (current default)
- machine: JSON lines for piping to external tools

Part 3 of the #12572 split (depends on build report PR #12695).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
gnodet added a commit that referenced this pull request Aug 8, 2026
Add the --console CLI flag with four output modes:
- plain: compact one-line-per-module output for CI
- rich: JLine status bar with live reactor progress
- verbose: full mojo-level output (current default)
- machine: JSON lines for piping to external tools

Part 3 of the #12572 split (depends on build report PR #12695).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@gnodet
gnodet force-pushed the feature/build-report branch from 8083c89 to 170bd72 Compare August 8, 2026 19:35
gnodet added a commit that referenced this pull request Aug 8, 2026
Add the --console CLI flag with four output modes:
- plain: compact one-line-per-module output for CI
- rich: JLine status bar with live reactor progress
- verbose: full mojo-level output (current default)
- machine: JSON lines for piping to external tools

Part 3 of the #12572 split (depends on build report PR #12695).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@gnodet
gnodet force-pushed the feature/build-report branch from 170bd72 to af0cc72 Compare August 8, 2026 21:48
gnodet added a commit that referenced this pull request Aug 8, 2026
Add the --console CLI flag with four output modes:
- plain: compact one-line-per-module output for CI
- rich: JLine status bar with live reactor progress
- verbose: full mojo-level output (current default)
- machine: JSON lines for piping to external tools

Part 3 of the #12572 split (depends on build report PR #12695).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@gnodet
gnodet force-pushed the feature/logging-foundation branch from 8baa65a to 02ac855 Compare August 9, 2026 08:11
@gnodet
gnodet force-pushed the feature/build-report branch from af0cc72 to 3658983 Compare August 9, 2026 08:11
@gnodet
gnodet marked this pull request as ready for review August 9, 2026 08:11

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-designed build report feature with clean API/impl separation and comprehensive tests. A few issues noted below.

Also noted:

  • The architecture is solid: clean API interfaces in maven-api-core, record-based implementations in maven-core, EventSpy pattern for automatic discovery, thread-based log routing for parallel-build safety, atomic file writes with symlink swap.
  • The PR correctly depends on PR #12694 (logging foundation) — should not be merged until #12694 lands.
  • No test for the captureLogEvent routing logic (mojo-level vs module-level vs build-level buffers). This is the core routing mechanism and warrants at least one test exercising the dispatch.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-designed build report feature with clean API/impl separation, solid thread safety, and comprehensive tests. A few issues worth addressing:

Confirmed findings (verified independently):

  1. [Medium] BuildReportCollector.java — The Javadoc on MAX_LOG_EVENTS_PER_SCOPE states "events are dropped and a truncation notice is appended," but captureLogEvent silently drops events without ever appending a truncation notice. Either implement the truncation notice (e.g., append a synthetic LogEvent like "... N events truncated") or correct the Javadoc to say events are silently dropped.

  2. [Low] BuildReportJsonWriter.java — The writeNullableField method has an unused boolean hasMore parameter annotated with @SuppressWarnings("unused"). The parameter is never read and the method always emits a trailing comma regardless. Remove it to avoid confusion.

  3. [Low] BuildReportJsonWriter.java — writeProblem uses sb.lastIndexOf(",\n") to remove trailing commas (searches entire buffer backwards), while writeLogEvent uses the dedicated removeTrailingComma helper (checks only last two characters). Use removeTrailingComma consistently — it's safer since lastIndexOf could theoretically match an earlier ,\n if future refactors change field order.

This review was generated by an AI agent (Claude Code) and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

gnodet added a commit to gnodet/maven that referenced this pull request Aug 16, 2026
@gnodet gnodet added this to the 4.1.0 milestone Aug 23, 2026

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-structured addition of a JSON build report feature with clean API design, good test coverage (17 tests), and defensive error handling. The zero-dependency JSON writer is appropriate for Maven's philosophy. A few design items:

Medium severity:

  1. No opt-out mechanism (BuildReportCollector.java): The collector is unconditionally active for every build — every mvn invocation writes a JSON file to disk with no system property to disable it. Consider adding -Dmaven.build.report.skip=true for environments where this is undesirable (read-only filesystems, embedded invocations, CI runners).

  2. MojoSkipped events not handled (BuildReportCollector.java): ExecutionEvent.Type.MojoSkipped (fired e.g. when a mojo requires online mode but Maven is offline) silently vanishes from the report. Inconsistent with ProjectSkipped which IS handled. Skipped mojos should be tracked with BuildStatus.SKIPPED.

Low severity:

  1. Failure timestamp inaccuracy (BuildReportCollector.java line 1110): failureTimestamp is set to MonotonicClock.now() at report-assembly time, not at actual failure time. The mojo's timing data does capture the real timing — worth documenting in the FailureReport.timestamp() Javadoc.

  2. Inconsistent trailing comma removal (BuildReportJsonWriter.java): writeProblem uses sb.lastIndexOf(",\n") which searches backwards through the entire buffer, while writeLogEvent uses the more robust removeTrailingComma(sb) which checks only the end. Consider using removeTrailingComma consistently.

  3. Unused hasMore parameter (BuildReportJsonWriter.java line 1553): Annotated @SuppressWarnings("unused") and never referenced. Either use it to control comma behavior or remove it.

  4. ~70 lines of duplicated test helpers: BuildReportCollectorTest and BuildReportIntegrationTest share identical createProject, createSession, createMojoExecution, and createEvent methods. Consider extracting to a shared test utility.

The API design (immutable interfaces in maven-api-core, record implementations in maven-core, @Experimental markers) follows Maven's established patterns. Thread safety approach is sound. The atomic file write + symlink pattern is well-implemented with proper fallbacks.


This review was generated by an AI agent (Claude Code) and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

@gnodet
gnodet force-pushed the feature/build-report branch from 3658983 to c51ee87 Compare August 28, 2026 09:28
@gnodet
gnodet force-pushed the feature/logging-foundation branch from 02ac855 to 812a842 Compare August 28, 2026 09:28

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of commit 92a187fb — build report + BuildEnvironment (2026-09-21).

Substantial progress since the last review. Many long-standing findings are now resolved:

  • ✅ Truncation notice Javadoc fixed — MAX_LOG_EVENTS_PER_SCOPE now correctly says "silently dropped"
  • ✅ writeNullableField dead hasMore parameter removed
  • ✅ DefaultSession.buildEnvironment() now uses double-checked locking with a volatile field — correctly cached
  • ✅ batchMode/noTransferProgress Javadoc updated — both fields are now in the "What is captured" list
  • ✅ sequenceNumber() Javadoc fixed — now says "or -1 if unavailable" instead of "always non-negative"
  • ✅ hasReportCapture() guard restored in DefaultLog.withMetadata() — StackWalker cost is gated
  • ✅ MojoSkipped handled in BuildReportCollector
  • ✅ Session.buildEnvironment() Javadoc no longer claims "same object as in report"

One remaining issue in captureLogEvent — see inline comment.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

gnodet added a commit to gnodet/maven that referenced this pull request Sep 23, 2026
- Add reactor.mdo model to maven-api-core (ReactorConfig, Alias,
  PhaseInjection, ReactorExtension)
- Fix reader-stax.vm template: handle String* flat associations correctly
  (avoid variable shadowing in generated parseXxx() methods)
- Re-enable generated ReactorConfigStaxReader in maven-cli
- Fold BuildEnvironment (PR apache#12695) into feature branch
- Wire ReactorConfig through InvokerRequest -> MavenExecutionRequest
  -> BuildEnvironment -> Session API
- Add MojoExecutionFilter with CoordinatePredicate / PhasePredicate
- Add ArgumentTokenizer (quote-aware) for alias/option expansion
- Add MavenParser: alias expansion, reactor.xml options merge
- Null-guard getUserProperties() in DefaultLifecycleExecutionPlanCalculator
gnodet added a commit to gnodet/maven that referenced this pull request Sep 23, 2026
- Add reactor.mdo model to maven-api-core (ReactorConfig, Alias,
  PhaseInjection, ReactorExtension)
- Fix reader-stax.vm template: handle String* flat associations correctly
  (avoid variable shadowing in generated parseXxx() methods)
- Re-enable generated ReactorConfigStaxReader in maven-cli
- Fold BuildEnvironment (PR apache#12695) into feature branch
- Wire ReactorConfig through InvokerRequest -> MavenExecutionRequest
  -> BuildEnvironment -> Session API
- Add MojoExecutionFilter with CoordinatePredicate / PhasePredicate
- Add ArgumentTokenizer (quote-aware) for alias/option expansion
- Add MavenParser: alias expansion, reactor.xml options merge
- Null-guard getUserProperties() in DefaultLifecycleExecutionPlanCalculator
gnodet added a commit to gnodet/maven that referenced this pull request Sep 23, 2026
- Add reactor.mdo model to maven-api-core (ReactorConfig, Alias,
  PhaseInjection, ReactorExtension)
- Fix reader-stax.vm template: handle String* flat associations correctly
  (avoid variable shadowing in generated parseXxx() methods)
- Re-enable generated ReactorConfigStaxReader in maven-cli
- Fold BuildEnvironment (PR apache#12695) into feature branch
- Wire ReactorConfig through InvokerRequest -> MavenExecutionRequest
  -> BuildEnvironment -> Session API
- Add MojoExecutionFilter with CoordinatePredicate / PhasePredicate
- Add ArgumentTokenizer (quote-aware) for alias/option expansion
- Add MavenParser: alias expansion, reactor.xml options merge
- Null-guard getUserProperties() in DefaultLifecycleExecutionPlanCalculator
gnodet added a commit to gnodet/maven that referenced this pull request Sep 23, 2026
- Add reactor.mdo model to maven-api-core (ReactorConfig, Alias,
  PhaseInjection, ReactorExtension)
- Fix reader-stax.vm template: handle String* flat associations correctly
  (avoid variable shadowing in generated parseXxx() methods)
- Re-enable generated ReactorConfigStaxReader in maven-cli
- Fold BuildEnvironment (PR apache#12695) into feature branch
- Wire ReactorConfig through InvokerRequest -> MavenExecutionRequest
  -> BuildEnvironment -> Session API
- Add MojoExecutionFilter with CoordinatePredicate / PhasePredicate
- Add ArgumentTokenizer (quote-aware) for alias/option expansion
- Add MavenParser: alias expansion, reactor.xml options merge
- Null-guard getUserProperties() in DefaultLifecycleExecutionPlanCalculator
gnodet added a commit to gnodet/maven that referenced this pull request Sep 23, 2026
…filter

Introduces two features that build on top of the logging foundation and
structured build report (MNG-XXXXX / PR apache#12695):

1. reactor.xml — a single .mvn/reactor.xml file that consolidates CLI
   options (replaces .mvn/maven.config), core extensions (replaces
   .mvn/extensions.xml), named build aliases, and lifecycle phase
   injections.  Legacy files continue to be read when reactor.xml is
   absent — full backwards compatibility is preserved.

2. Named build aliases — short names defined in reactor.xml that expand
   to a full argument list before any Maven processing starts.
   Expansion is non-recursive; flag-style aliases (--skip-tests) are
   supported; blank alias names are rejected at expansion time.

3. Lifecycle execution filter — a maven.lifecycle.filter user property
   that skips mojo executions matching a coordinate or phase predicate
   (e.g. phase(test),:maven-enforcer-plugin).  Applied in MojoExecutor
   before each execution; skipped mojos fire a MojoSkipped event.
gnodet added a commit to gnodet/maven that referenced this pull request Sep 23, 2026
…filter

Introduces two features that build on top of the logging foundation and
structured build report (MNG-XXXXX / PR apache#12695):

1. reactor.xml — a single .mvn/reactor.xml file that consolidates CLI
   options (replaces .mvn/maven.config), core extensions (replaces
   .mvn/extensions.xml), named build aliases, and lifecycle phase
   injections.  Legacy files continue to be read when reactor.xml is
   absent — full backwards compatibility is preserved.

2. Named build aliases — short names defined in reactor.xml that expand
   to a full argument list before any Maven processing starts.
   Expansion is non-recursive; flag-style aliases (--skip-tests) are
   supported; blank alias names are rejected at expansion time.

3. Lifecycle execution filter — a maven.lifecycle.filter user property
   that skips mojo executions matching a coordinate or phase predicate
   (e.g. phase(test),:maven-enforcer-plugin).  Applied in MojoExecutor
   before each execution; skipped mojos fire a MojoSkipped event.
@gnodet gnodet added enhancement New feature or request mvn4 labels Oct 14, 2026
gnodet added a commit to gnodet/maven that referenced this pull request Oct 14, 2026
…filter

Introduces two features that build on top of the logging foundation and
structured build report (MNG-XXXXX / PR apache#12695):

1. reactor.xml — a single .mvn/reactor.xml file that consolidates CLI
   options (replaces .mvn/maven.config), core extensions (replaces
   .mvn/extensions.xml), named build aliases, and lifecycle phase
   injections.  Legacy files continue to be read when reactor.xml is
   absent — full backwards compatibility is preserved.

2. Named build aliases — short names defined in reactor.xml that expand
   to a full argument list before any Maven processing starts.
   Expansion is non-recursive; flag-style aliases (--skip-tests) are
   supported; blank alias names are rejected at expansion time.

3. Lifecycle execution filter — a maven.lifecycle.filter user property
   that skips mojo executions matching a coordinate or phase predicate
   (e.g. phase(test),:maven-enforcer-plugin).  Applied in MojoExecutor
   before each execution; skipped mojos fire a MojoSkipped event.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of commit 7d7854b2 — Javadoc addition to MavenJulHandler.LOGGER_CACHE.

New commit (7d7854b2) is clean: The added Javadoc clarifies that LOGGER_CACHE is intentionally unbounded, bounded in practice by the number of distinct JUL logger names, and grows monotonically in long-running daemon processes. This is accurate and appropriate.

One finding remains unaddressed (raised in prior review of 92a187fb): see inline comment.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewing after the latest commits — this is a clean pass.

The ThreadLocal elimination is well-executed. Passing BuildEventListener and MessageBuilderFactory as inline parameters throughout the lifecycle callbacks is the right architectural move — ThreadLocals for lifecycle context are a code smell (hidden state, tricky in tests, painful in custom embedders).

The log capture machinery in DefaultBuildEventListener is correct. A potential TOCTOU concern on the size() < MAX && add() compound check in mojoLogBuffers / moduleLogBuffers was examined carefully — it is a false alarm. Because currentMojoByThread and currentProjectByThread are keyed by Thread.currentThread().getId(), each mojo/module buffer is exclusively accessed by a single thread: the thread that registered its key. No external synchronization is needed for those buffers. The contrast with buildLogBuffer (which correctly uses synchronized) is sound — that buffer is shared across threads (reactor startup/shutdown paths).

One minor documentation suggestion: a brief comment at the size() < MAX && add() check (line ~316) noting the single-thread-per-buffer invariant would help future readers not re-analyze this.

All new code is well-covered by tests. The API changes are appropriate for unreleased 4.1.0.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

gnodet and others added 3 commits October 15, 2026 14:05
Introduce BuildEnvironment as a v4 API type on Session, providing
a structured, immutable snapshot of the build invocation context:
goals, user properties (with sensitive values redacted), curated
system info, profiles, project selection, offline/batch flags, and
concurrency settings.

Available via Session.buildEnvironment() for plugins and extensions
that need to inspect the build configuration programmatically.

Related: #13460 (v3→v4 API migration)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…enhancements

Structured LogEvent (maven-api-core, maven-core):
- LogEvent / LogLevel API for structured log event representation
- Source metadata: sourceClassName(), sourceMethodName(), threadId()
- Execution context: projectId() and mojoId()

Custom JUL Handler (maven-logging):
- MavenJulHandler replaces SLF4JBridgeHandler — all JUL events route
  through SLF4J for consistent formatting regardless of origin
- JUL metadata flows as method parameters via logDirect() instead of
  ThreadLocals
- Re-entrancy guard for JLine StyleResolver → JUL → SLF4J bootstrap cycle

Direct logging path (maven-logging, maven-core):
- MavenSimpleLogger.logDirect() bypasses the SLF4J call chain for Log API
  and JUL events, carrying source metadata as parameters
- MavenBaseLogger.formatLogPrefix() extracted as shared formatting logic
- Eliminates ThreadLocal round-trips, lambda allocations, and SLF4J
  dispatch overhead for Maven-controlled logging paths

Capability-driven optimization (maven-logging):
- LogSink.needsFormattedMessage() — skip formatting when consumer uses
  structured fields (e.g. machine/JSON output mode)
- LogSink.needsMetadata() — skip StackWalker and SourceMetadata allocation
  when consumer doesn't read source info (plain/rich console modes)
- ProjectBuildLogAppender wires flags: metadata auto-enabled when
  reportCapture is active

Structured LogSink (maven-logging, maven-core):
- MavenSimpleLogger.LogSink replaces Consumer<String> with structured
  callback including level, logger name, clean message, and metadata
- ProjectBuildLogAppender produces LogEvent objects with source metadata
- BuildEventListener.projectLogMessage() now takes LogEvent

Log API metadata (maven-core):
- DefaultLog resolves caller class/method via StackWalker, gated behind
  LogSink.needsMetadata() for zero overhead in plain/rich console modes

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add "reportVersion": "1.0" as the first field in the JSON output
so external consumers can detect format changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on my prior review (approved at 690d8a84). The new commit (4d4ccfbde8f7) adds reportVersion() — two issues.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Expose optional trace and span identifiers for module and mojo reports. Capture tracing context from the SLF4J MDC at lifecycle start events and include it in JSON build reports.

Bump the additive report schema version and cover both populated and absent correlation fields in tests.
* @return the matching module report, or empty if not found
*/
@Nonnull
default Optional<ModuleReport> findModule(String moduleId) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally very happy with it but shouldn't it be findSubProject now? 🤔

* @return the error message, never {@code null}
*/
@Nonnull
String message();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not keeping the exception there?

* @since 4.1.0
*/
@Nullable
String traceId();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd create a TracingContext wrapper or alike with traceid+spanId+parentSpanId

also not sure we must use String for these values since often they can be stored as long so maybe Object or alike

* stable across Maven versions — field order is fixed, and new fields are
* appended at the end of each object.
*/
final class BuildReportJsonWriter {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd avoid the strinbuilder totally and pass directly the outputstream/writer, no need to have it in mem at all

/**
* Internal immutable implementation of {@link ModuleReport}.
*/
record DefaultModuleReport(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think we can make mojos/output read only at instantiation time so no need of overrides (same for most records)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mvn4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants