Skip to content

Console modes: --console=plain/rich/verbose/machine - #12697

Draft
gnodet wants to merge 1 commit into
feature/build-reportfrom
feature/console-modes
Draft

Console modes: --console=plain/rich/verbose/machine#12697
gnodet wants to merge 1 commit into
feature/build-reportfrom
feature/console-modes

Conversation

@gnodet

@gnodet gnodet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

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

Adds the --console CLI flag with four output modes:

  • plain — compact one-line-per-module output, ideal for CI (auto-selected in CI environments)
  • rich — JLine status bar with live reactor progress (auto-selected on interactive TTYs)
  • verbose — full mojo-level output, current Maven 4.0 default behavior
  • machine — JSON lines: one typed JSON object per lifecycle event, designed for piping to external tools

Auto-detection (--console=auto, the default): CI → plain, interactive TTY → rich, otherwise → verbose.

Files changed (16 files, ~4000 insertions)

Area Files
API Options.java (+console())
Event loggers PlainExecutionEventLogger, RichBuildEventListener, RichExecutionEventLogger, MachineBuildEventListener, MachineExecutionEventLogger
CLI wiring CommonsCliOptions, LayeredOptions, LookupInvoker (preliminary interactive detection), MavenInvoker (console mode switch + transfer listener)
Existing logger ExecutionEventLogger (version info on failure)
Tests 5 test classes with full coverage

PR chain

  1. ✅ PR Logging foundation: structured LogEvent, JUL handler, Log API enhancements #12694 — Logging foundation (feature/logging-foundationmaster)
  2. ✅ PR Build report: structured JSON report with per-mojo log capture #12695 — Build report (feature/build-reportfeature/logging-foundation)
  3. This PR — Console modes (feature/console-modesfeature/build-report)
  4. 🔜 PR — Warning mode + diagnostics
  5. 🔜 PR — mvnlog viewer

Test plan

  • mvn test -pl impl/maven-cli — all 692 tests pass
  • mvn test -pl impl/maven-core — all tests pass
  • CI validation

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the feature/build-report branch from 602fffb to 056dcf0 Compare August 8, 2026 01:23
@gnodet
gnodet force-pushed the feature/console-modes branch from b0617f7 to 1a419b7 Compare August 8, 2026 01:23
gnodet added a commit that referenced this pull request Aug 8, 2026
Add --warning-mode CLI flag (summary/all/none/fail) for controlling
how build warnings are displayed. Enrich BuilderProblem with key,
suggestion, documentationUrl, INFO severity, and a builder API.
Add DiagnosticReporter service and DefaultDiagnosticCollector for
deduplication across parallel module builds.

Part 4 of the #12572 split (depends on console modes PR #12697).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant