Skip to content

mvnlog: build log viewer, integration tests, script routing - #12699

Draft
gnodet wants to merge 1 commit into
feature/warning-modefrom
feature/mvnlog
Draft

mvnlog: build log viewer, integration tests, script routing#12699
gnodet wants to merge 1 commit into
feature/warning-modefrom
feature/mvnlog

Conversation

@gnodet

@gnodet gnodet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Part 5 of the logging feature chain. Depends on #12698 (warning mode).

Adds the mvnlog tool — a CLI viewer for build-report JSON files — plus integration tests for the entire feature set and script routing.

mvnlog viewer

  • mvnlog / mvnlog --json — view the latest build report as human-readable or raw JSON
  • BuildReportRenderer — renders reports with ANSI colors, timing, failure details
  • SimpleJsonReader — dependency-free streaming JSON parser
  • LogInvoker / LogParser / LogContext — invoker chain for the tool
  • CommonsCliLogOptions / LogOptions — CLI option parsing
  • MavenLogCling — entry point class

Script routing

  • mvn --log routes to MavenLogCling (both mvn and mvn.cmd)
  • Script argument stripping prevents --log from colliding with --log-file prefix matching
  • mvnlog / mvnlog.cmd shell scripts for direct invocation
  • component.xml updated to include mvnlog in the distribution

Integration tests

  • MavenITgh12571BuildReportTest — 8 IT tests covering build report JSON, console modes (plain/machine/verbose), warning mode, version info on failure, and mvnlog viewer
  • 11 existing ITs updated with --console=verbose to preserve expected output format
  • IT test resources (single module + multi-module project POMs)

Files changed (36 files, ~2500 insertions)

Area Files
API Tools.java, LogOptions, ParserRequest
Entry point MavenLogCling
Invoker LogInvoker, LogParser, LogContext, CommonsCliLogOptions
Renderer BuildReportRenderer, SimpleJsonReader
Shell BuiltinShellCommandRegistryFactory (mvnlog command)
Scripts mvn, mvn.cmd, mvnlog, mvnlog.cmd, component.xml
CLI CommonsCliOptions (+--log constant/option)
Tests BuildReportRendererTest, SimpleJsonReaderTest
ITs MavenITgh12571BuildReportTest + 11 existing ITs + 4 resource POMs

PR chain (complete)

# PR Feature
1 #12694 Logging foundation
2 #12695 Build report
3 #12697 Console modes
4 #12698 Warning mode + diagnostics
5 This PR mvnlog viewer
#12702 Structured problems pipeline

Test plan

  • mvn compile — clean compile
  • mvn test -pl impl/maven-cli — all tests pass
  • CI validation

🤖 Generated with Claude Code

Add the mvnlog tool for viewing and analyzing build-report JSON files.
Includes BuildReportRenderer for human-readable output, SimpleJsonReader
for dependency-free JSON parsing, shell scripts (mvnlog/mvnlog.cmd),
and --log routing in mvn/mvn.cmd. Also adds integration tests for
build report generation, console modes, and the mvnlog viewer, plus
--console=verbose flags for ITs that depend on verbose output.

Part 5 of the #12572 split (depends on warning mode PR #12698).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the feature/warning-mode branch from 7243fd7 to af945c2 Compare August 8, 2026 19:35
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