-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
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
- [MNG-6662] More concise logging #8571 (MNG-6662): More concise logging — suppress mojo-level output
- [MNG-7008] skip reactor logging #8027 (MNG-7008): Skip reactor logging — error messages buried in huge reactor output
- [MNG-7941] Meaning of -ntp CLI Option vs. --batch-mode #8973 (MNG-7941): Meaning of -ntp vs --batch-mode — cleaner separation of output controls
- Change maven cli defaults based on
CIenv variable #11088: CI env variable defaults — auto-detect CI and adjust output - [MNG-7484] Collect warnings from different MOJO executions and give a comprehensive summary at the end of the build #8976 (MNG-7484): Warning summary at end of build — surface warnings that get buried
- [MNG-5932] Per-user and per-project logging configuration #7500 (MNG-5932): Per-user/project logging configuration
- [MNG-8071] Build in parallel by default #10872 (MNG-8071): Build in parallel by default — output must handle concurrent modules
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.logautomatically
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
- Default to less, not more — most users only care about: what's building, did it succeed, and if not, what failed
- Log file by default — all
[INFO]-level plugin output goes to a log file. Console shows only progress + warnings + errors - 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)
- Parallel-aware — with parallel builds ([MNG-8071] Build in parallel by default #10872), the status bar shows multiple concurrent modules like mvnd does
- Progressive disclosure —
mvn(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) ExecutionEventLoggercaptures all lifecycle eventsConsoleMavenTransferListenerdoes\r-based progressCIDetectorclasses detect CI environments- mvnd's
TerminalOutputprovides 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.