gnodet opened a new pull request, #12699: URL: https://github.com/apache/maven/pull/12699
## Summary Part 5 (final) of the [#12572](https://github.com/apache/maven/pull/12572) split. Depends on PR #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) 1. ✅ PR #12694 — Logging foundation (`feature/logging-foundation` → `master`) 2. ✅ PR #12695 — Build report (`feature/build-report` → `feature/logging-foundation`) 3. ✅ PR #12697 — Console modes (`feature/console-modes` → `feature/build-report`) 4. ✅ PR #12698 — Warning mode + diagnostics (`feature/warning-mode` → `feature/console-modes`) 5. **This PR** — `mvnlog` viewer (`feature/mvnlog` → `feature/warning-mode`) ## Test plan - [x] `mvn compile` — clean compile - [x] `mvn test -pl impl/maven-cli` — all tests pass - [ ] CI validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
