gnodet opened a new pull request, #12698:
URL: https://github.com/apache/maven/pull/12698

   ## Summary
   Part 4 of the [#12572](https://github.com/apache/maven/pull/12572) split. 
Depends on PR #12697 (console modes).
   
   Adds `--warning-mode` CLI flag and structured diagnostic infrastructure:
   
   - **`--warning-mode=summary`** (default) — deduplicated warning summary at 
end of build
   - **`--warning-mode=all`** — inline warnings + summary
   - **`--warning-mode=none`** — suppress diagnostic summary
   - **`--warning-mode=fail`** — treat warnings as build errors
   
   ### BuilderProblem API enrichments
   - `getKey()` — stable deduplication key for cross-module dedup
   - `getSuggestion()` — actionable fix suggestion
   - `getDocumentationUrl()` — link to relevant docs
   - `INFO` severity level added to `Severity` enum
   - `BuilderProblem.builder()` — fluent builder API with `DefaultProblem` 
record
   
   ### New service API
   - `DiagnosticReporter` — `@Inject`-able service for plugins to report 
structured problems
   
   ### Internal infrastructure
   - `DefaultDiagnosticCollector` — thread-safe, deduplicating problem store 
with suppression support
   - `DefaultDiagnosticReporter` / `DefaultDiagnosticSummary` — wiring
   - `BuildReportCollector` upgraded to use `DefaultDiagnosticCollector`, 
auto-collect WARN log events, print summary
   
   ## Files changed (16 files, ~1600 insertions)
   
   | Area | Files |
   |------|-------|
   | API | `BuilderProblem` enrichments, `DiagnosticReporter`, `Options` 
(+`warningMode()`) |
   | CLI wiring | `CommonsCliOptions`, `LayeredOptions`, `MavenInvoker` |
   | Collector | `BuildReportCollector` (full diagnostic integration), 
`BuildReportJsonWriter` (problem enrichments) |
   | Internal | `DefaultDiagnosticCollector`, `DefaultDiagnosticReporter`, 
`DefaultDiagnosticSummary` |
   | Impl | `DefaultBuilderProblem` (key/suggestion/url fields) |
   | Tests | 4 test classes updated + 1 new (`DefaultDiagnosticCollectorTest`) |
   
   ## PR chain
   1. ✅ PR #12694 — Logging foundation
   2. ✅ PR #12695 — Build report
   3. ✅ PR #12697 — Console modes
   4. **This PR** — Warning mode + diagnostics (`feature/warning-mode` → 
`feature/console-modes`)
   5. 🔜 PR — `mvnlog` viewer
   
   ## Test plan
   - [x] `mvn test -pl impl/maven-core` — all tests pass
   - [x] `mvn test -pl impl/maven-cli` — all 692+ 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]

Reply via email to