Skip to content

Redesign Maven console output: smart terminal, log file, structured summaries #11819

@gnodet

Description

@gnodet

Summary

Maven's current console output is excessively verbose and makes it hard to find relevant information. In large multi-module builds (100+ modules), users are overwhelmed with noise — plugin execution banners, download progress lines, and repetitive separators — while actual warnings and errors get buried.

This proposal redesigns Maven's default console output to be concise, informative, and modern, inspired by tools like maven-daemon (mvnd), Gradle, and Cargo.

Related Issues

Proposal

Mode 1: Smart/Rich Terminal Output (default when interactive TTY)

Using JLine (already a dependency), Maven uses a fixed-bottom status area with scrolling log above:

 ✓ my-core                                                     1.2s
 ✓ my-api                                                      0.8s
 Building my-app 2.0.0                                        [3/12]
   ✓ maven-clean-plugin:clean                                  0.1s
   ✓ maven-resources-plugin:resources                          0.3s
   ● maven-compiler-plugin:compile                             1.2s
   ↓ junit-jupiter-api-5.10.jar                          234/512 KB

────────────────────────────────────────────────────────────────────
 my-core ✓  my-api ✓  my-utils ✓  my-app ●  my-web ⏳  [5/12]  32s

Key principles:

  • Fixed status bar at the bottom showing currently building modules (parallel-aware), overall progress, elapsed time
  • Compact per-module output — module name, plugin goals completing (✓/✗), timing
  • Downloads shown inline with progress, then cleared when done
  • Warnings/errors always bubble up — never scrolled away
  • Full log written to target/build.log automatically

Mode 2: CI/Batch Output (default when CI env var set or --batch-mode)

[INFO] Building my-core 2.0.0 [1/12]
[INFO] Building my-api 2.0.0 [2/12]
[WARN] my-utils: maven-compiler-plugin: source/target 8 is deprecated
[INFO] Building my-app 2.0.0 [4/12]
[ERROR] my-app: maven-compiler-plugin:compile FAILED (1.2s)

── Build Summary ──────────────────────────────────────────────────
  my-core ..................... SUCCESS [  1.2s]
  my-api ...................... SUCCESS [  0.8s]
  my-utils .................... SUCCESS [  2.1s]  ⚠ 1 warning
  my-app ...................... FAILURE [  1.2s]

── Warnings ───────────────────────────────────────────────────────
  my-utils: source/target 8 is deprecated, use 11+

── Error ──────────────────────────────────────────────────────────
  my-app: compilation failure (3 errors)
    src/main/java/App.java:42: cannot find symbol

BUILD FAILURE  Total: 12.3s
Full log: target/build.log

Mode 3: Verbose (-X / --verbose)

Same as current Maven output — full scrolling output for debugging.

Design Choices

  1. Default to less, not more — most users only care about: what's building, did it succeed, and if not, what failed
  2. Log file by default — all [INFO]-level plugin output goes to a log file. Console shows only progress + warnings + errors
  3. Structured warnings/errors at the end — surfaces warnings that get buried in hundreds of lines ([MNG-7484] Collect warnings from different MOJO executions and give a comprehensive summary at the end of the build #8976)
  4. Parallel-aware — with parallel builds ([MNG-8071] Build in parallel by default #10872), the status bar shows multiple concurrent modules like mvnd does
  5. Progressive disclosuremvn (concise) → mvn --verbose (full mojo output) → mvn -X (debug)

Implementation Notes

Building blocks already exist in the codebase:

  • JLine is already a dependency (maven-jline)
  • ExecutionEventLogger captures all lifecycle events
  • ConsoleMavenTransferListener does \r-based progress
  • CIDetector classes detect CI environments
  • mvnd's TerminalOutput provides a proven reference implementation

The core change: a new SmartExecutionEventLogger using JLine's Display API to manage a fixed status region, while delegating full output to a file-based log writer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions