GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mvnlog: build log viewer, integration tests, script routing by gnodet · Pull Request #12699 · apache/maven

Conversation

@gnodet

@gnodet gnodet commented Aug 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

# PR Feature
1 #12694 Logging foundation
2 #12695 Build report
3 #13180 Console modes
4 #12698 Warning mode + diagnostics
5 This PR mvnlog viewer
6 #12702 Structured problems pipeline
7 #12714 TRACE level migration

Test plan

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

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet gnodet mentioned this pull request Aug 7, 2026
Build report, console modes, and warning control #12572
Closed
@gnodet
gnodet force-pushed the feature/warning-mode branch from 0cc76eb to 6124231 Compare August 8, 2026 01:23
@gnodet
gnodet force-pushed the feature/mvnlog branch from e89c4e9 to e741028 Compare August 8, 2026 01:23
This was referenced Aug 8, 2026
Structured BuilderProblem pipeline for DiagnosticCollector #12702
Closed
Logging foundation: structured LogEvent, JUL handler, Log API enhancements #12694
Closed
Build report: structured JSON report with per-mojo log capture #12695
Closed
Console modes: --console=plain/rich/verbose/machine #12697
Closed
Warning mode, diagnostic collector, BuilderProblem enrichments #12698
Closed
@gnodet
gnodet force-pushed the feature/mvnlog branch from e741028 to ed79eea Compare August 8, 2026 05:35
@gnodet
gnodet force-pushed the feature/warning-mode branch 2 times, most recently from dc3bccd to a7c83db Compare August 8, 2026 12:14
@gnodet
gnodet force-pushed the feature/mvnlog branch from ed79eea to 8f829c0 Compare August 8, 2026 12:14
@gnodet
gnodet force-pushed the feature/warning-mode branch from a7c83db to 7243fd7 Compare August 8, 2026 19:17
@gnodet
gnodet force-pushed the feature/mvnlog branch from 8f829c0 to ce16de4 Compare August 8, 2026 19:17
@gnodet
gnodet force-pushed the feature/warning-mode branch from 7243fd7 to af945c2 Compare August 8, 2026 19:35
@gnodet
gnodet force-pushed the feature/mvnlog branch from ce16de4 to 7010176 Compare August 8, 2026 19:35
@gnodet
gnodet force-pushed the feature/warning-mode branch from af945c2 to 850a04c Compare August 8, 2026 21:48
@gnodet
gnodet force-pushed the feature/mvnlog branch 2 times, most recently from 9924a43 to 4d7e49f Compare August 8, 2026 21:57
@gnodet gnodet mentioned this pull request Aug 9, 2026
Migrate internal plumbing DEBUG statements to TRACE level #12714
Draft
3 of 4 tasks
@gnodet
gnodet force-pushed the feature/warning-mode branch from 850a04c to 5913a2b Compare August 9, 2026 08:11
@gnodet
gnodet force-pushed the feature/mvnlog branch from 4d7e49f to d76d6c1 Compare August 9, 2026 08:11
@gnodet
gnodet marked this pull request as ready for review August 9, 2026 08:11
gnodet
gnodet commented Aug 9, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well-structured mvnlog tool that follows established Maven tool patterns. Two minor polish items noted after verification (three other findings about shell script flag stripping and JSON parser depth were false positives).

Also noted:

  • The zero-dependency JSON reader/writer approach is sound — no JSON library exists in maven-cli's dependency tree.
  • The 11 existing IT modifications adding --console=verbose are necessary for the new console mode system.
  • Strong test coverage with 12 integration test cases.

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

Claude Code on behalf of gnodet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...in/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java
}
}

private List<Completer> mvnlogCompleter(String name) {

@gnodet gnodet Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The tab-completer only offers --diagnostics, --failures, --full, --list but is missing 5 of the 9 supported options: --json, --module, --mojo, --level, --grep. This reduces discoverability in mvnsh.

Suggested change
private List<Completer> mvnlogCompleter(String name) {
private List<Completer> mvnlogCompleter(String name) {
return List.of(new ArgumentCompleter(new StringsCompleter(
"--diagnostics", "--failures", "--full", "--list", "--json",
"--module", "--mojo", "--level", "--grep")));

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet gnodet mentioned this pull request Aug 9, 2026
#12572 introduced mvnlog #12716
Closed
gnodet
gnodet commented Aug 16, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well-structured addition of the mvnlog viewer tool that follows established Maven tool patterns. Two minor polish items:

Confirmed findings (verified independently):

  1. [Medium — Dead code] BuildReportRenderer.java:51 — Unused constant MAX_PADDED_BUILD_TIME_DURATION_LENGTH is declared but never referenced anywhere in the class. The formatDuration method does not use it. Appears to be a leftover copy from ExecutionEventLogger where it is actively used.

  2. [Low — Incomplete shell completer] BuiltinShellCommandRegistryFactory.java:268 — The mvnlogCompleter only includes --diagnostics, --failures, --full, --list but is missing the 5 filter/output options defined in CommonsCliLogOptions.CLIManager: --json, --module, --mojo, --level, --grep. Users in mvnsh will not get tab completion for these valid options.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvnlog/BuildReportRenderer.java
private final Consumer<String> output;

public BuildReportRenderer(MessageBuilderFactory messageBuilderFactory, Consumer<String> output) {
this.messageBuilderFactory = messageBuilderFactory;

@gnodet gnodet Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

[Medium — Dead code] This constant is declared but never referenced anywhere in this class. It's actively used in ExecutionEventLogger (lines 61 and 272), but appears to be a copy-paste leftover here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...in/java/org/apache/maven/cling/invoker/mvnsh/builtin/BuiltinShellCommandRegistryFactory.java
ParserRequest.mvnlog(input.args(), shellContext.invokerRequest.messageBuilderFactory())
.cwd(shellContext.cwd.get())
.build()));
} catch (InvokerException.ExitException e) {

@gnodet gnodet Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

[Low — Incomplete completer] This completer only includes 4 of the 9 options defined in CommonsCliLogOptions.CLIManager. Missing: --json, --module, --mojo, --level, --grep.

Users in mvnsh won't get tab completion for the filter features.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gnodet added a commit to gnodet/maven that referenced this pull request Aug 16, 2026
@gnodet
Update STATE.md — run 8: reviewed apache#12698, apache#12699, apache#…
333137c
…12702
gnodet added a commit to gnodet/maven that referenced this pull request Aug 17, 2026
@gnodet
Update STATE.md — run 11: reviewed apache#12699, apache#12707, apache…
86f976b
…#12694
@gnodet gnodet added this to the 4.1.0 milestone Aug 23, 2026
gnodet
gnodet commented Aug 24, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well-structured CLI viewer tool (mvnlog) with strong test coverage (33 unit tests + 12 integration tests). The zero-dependency JSON reader/writer is appropriate for the maven-cli module.

Security note: The security issues identified in the monolithic PR #12716 (HTTP server binding to 0.0.0.0, path traversal, CopyOnWriteArrayList) are not present in this decomposed PR — it has no network component. The System.exit() usage follows the established pattern in MavenCling.

Minor items from prior reviews still unaddressed:

  1. Dead code (BuildReportRenderer.java line 45): MAX_PADDED_BUILD_TIME_DURATION_LENGTH is declared but never referenced. Likely a leftover from ExecutionEventLogger copy.

  2. Incomplete shell completer (BuiltinShellCommandRegistryFactory.java): mvnlogCompleter only registers --diagnostics, --failures, --full, --list for tab completion but is missing 5 valid options: --json, --module, --mojo, --level, --grep.

  3. No nesting depth guard (SimpleJsonReader.java): The recursive descent parser has no depth limit. Pathologically nested input could cause StackOverflowError. Low risk since it only parses self-generated build reports, but a depth counter (max ~512) would be cheap hardening.

Overall looks good — the decomposition from #12716 into independently reviewable pieces is the right approach.


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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet gnodet mentioned this pull request Aug 27, 2026
Add mvnlog --web: local web server for interactive build report viewing #12645
Open
@gnodet
gnodet force-pushed the feature/mvnlog branch from d76d6c1 to bafae6b Compare August 28, 2026 09:28
@gnodet
gnodet force-pushed the feature/warning-mode branch 2 times, most recently from 2a54465 to 94ee4ef Compare August 28, 2026 09:55
@gnodet
gnodet force-pushed the feature/mvnlog branch from bafae6b to 47755e3 Compare August 28, 2026 09:55
gnodet
gnodet commented Aug 28, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Well-designed mvnlog viewer tool following established Maven CLI patterns. The zero-dependency JSON reader/writer pair is appropriate for maven-cli's dependency constraints, and the script routing approach is sound. Good integration test coverage with both positive and negative scenarios.

Five items to address:

1. Short option -l collision (high)

In CommonsCliLogOptions.java, LEVEL = "l" conflicts with the parent CommonsCliOptions.CLIManager.LOG_FILE = "l". When prepareOptions() calls super.prepareOptions(options), the parent registers -l as --log-file. Then line ~203 registers -l as --level. Commons CLI 1.11.0 silently overwrites, so -l will shadow --log-file and be interpreted as --level in the mvnlog context. Consider using a different short option for --level (e.g. -lv) or omitting the short form entirely.

2. Unused constant (medium)

BuildReportRenderer.java line ~45: MAX_PADDED_BUILD_TIME_DURATION_LENGTH is declared but never referenced. Dead code in new code.

3. Incomplete shell completer (medium)

BuiltinShellCommandRegistryFactory.java line ~268: mvnlogCompleter lists --diagnostics, --failures, --full, --list but is missing --json, --module, --mojo, --level, --grep — five valid options defined in CommonsCliLogOptions.CLIManager won't appear in tab-completion.

4. No trailing content check in JSON parser (low)

SimpleJsonReader.java line ~54: parse() does not verify pos == json.length() after parseValue(), so input like {"a":1}GARBAGE is silently accepted. Low risk since this only processes self-generated build reports.

5. Fully qualified java.util.List (low)

LogInvoker.java line ~143: Uses java.util.List<Map<String, Object>> fully qualified instead of importing java.util.List (while java.util.Map is already imported). Minor style inconsistency.

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

Claude Code on behalf of Guillaume Nodet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet
gnodet force-pushed the feature/warning-mode branch from 94ee4ef to 32ce980 Compare August 28, 2026 10:16
@gnodet
gnodet force-pushed the feature/mvnlog branch from 47755e3 to 11b4c52 Compare August 28, 2026 10:16
@gnodet gnodet mentioned this pull request Aug 28, 2026
mvnlog --web: local HTTP server for interactive build report viewer #12885
Closed
9 tasks
@gnodet
gnodet force-pushed the feature/warning-mode branch from 863b632 to 9e250d3 Compare August 31, 2026 08:55
@gnodet
gnodet force-pushed the feature/mvnlog branch from 11b4c52 to 69b8969 Compare August 31, 2026 08:55
@gnodet
gnodet force-pushed the feature/warning-mode branch from 9e250d3 to 995c624 Compare September 18, 2026 11:10
@gnodet
gnodet force-pushed the feature/mvnlog branch from 69b8969 to 79397b6 Compare September 18, 2026 11:10
@gnodet
mvnlog: build log viewer, integration tests, script routing
bde251c
@gnodet
gnodet force-pushed the feature/warning-mode branch from 995c624 to 1c1c332 Compare September 18, 2026 11:21
@gnodet
gnodet force-pushed the feature/mvnlog branch from 79397b6 to bde251c Compare September 18, 2026 11:21
@gnodet gnodet mentioned this pull request Sep 18, 2026
Console modes: --console=plain/rich/verbose/machine #13180
Draft
@gnodet gnodet added enhancement New feature or request mvn4 labels Oct 14, 2026
This was referenced Oct 15, 2026
feat: add BuildInvocation API to Session #13542
Merged
Build output overhaul: structured build report, diagnostic collector, console modes #12571
Open
@gnodet @claude
fix: add recursion depth limit to SimpleJsonReader
e1600db
Add MAX_DEPTH = 512 guard to prevent StackOverflowError on
pathologically nested JSON input.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@gnodet gnodet mentioned this pull request Oct 26, 2026
feat: mvnlog – build log viewer, integration tests, script routing gnodet/maven#126
Open
1 task
@gnodet gnodet closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement New feature or request mvn4

Projects

None yet

Milestone

4.2.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@gnodet
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.