Skip to content

Structured BuilderProblem pipeline for DiagnosticCollector - #12702

Draft
gnodet wants to merge 3 commits into
feature/warning-modefrom
feature/12643-structured-problems
Draft

Structured BuilderProblem pipeline for DiagnosticCollector#12702
gnodet wants to merge 3 commits into
feature/warning-modefrom
feature/12643-structured-problems

Conversation

@gnodet

@gnodet gnodet commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to the build report / warning mode chain. This PR implements the structured BuilderProblem pipeline for the 4 pathways identified in the foundation work, plus a full migration of the PluginValidationManager interface.

Commit 1: Pipe structured BuilderProblems into DiagnosticCollector (Pathways 1–4)

Pathway 2 — Plugin parameter validation (AbstractMavenPluginParametersValidator): 3 validators now create BuilderProblem with structured key, severity, and suggestion, and pipe through PluginValidationManagerDiagnosticCollector.

Pathway 3 — Plugin dependency validation (AbstractMavenPluginDependenciesValidator): 4 validators now create BuilderProblem with structured key and pipe through PluginValidationManagerDiagnosticCollector.

Pathway 4 — Plugin manager Contextualizable check (DefaultMavenPluginManager): creates BuilderProblem with key plugin-validation:contextualizable and pipes through PluginValidationManagerDiagnosticCollector.

Commit 2: Migrate PluginValidationManager to native BuilderProblem API

  • Changed PluginValidationManager interface: 3 abstract methods now accept BuilderProblem instead of String
  • Added @Deprecated(since = "4.1.0", forRemoval = true) String-based default methods as backward-compat adapters
  • Updated all 9 call sites across 8 files to create BuilderProblem natively

PR chain

Test plan

  • mvn test -pl impl/maven-core — tests pass
  • CI

🤖 Generated with Claude Code

@gnodet
gnodet force-pushed the feature/warning-mode branch from 6124231 to dc3bccd Compare August 8, 2026 05:35
@gnodet
gnodet force-pushed the feature/12643-structured-problems branch from 0e0c4e7 to 4463770 Compare August 8, 2026 05:35
@gnodet
gnodet force-pushed the feature/warning-mode branch from dc3bccd to a7c83db Compare August 8, 2026 12:14
@gnodet
gnodet force-pushed the feature/12643-structured-problems branch from 4463770 to 8ef52fb 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/12643-structured-problems branch from 8ef52fb to c5cdbba 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/12643-structured-problems branch from c5cdbba to b0d3de4 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/12643-structured-problems branch from b0d3de4 to dbf0ac6 Compare August 8, 2026 21:49
gnodet and others added 3 commits August 8, 2026 23:56
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>
…ollector

Route structured validation problems from 4 pathways (settings, toolchains,
model validation, graph building) into DefaultDiagnosticCollector so they
appear in the build report with full key/suggestion/documentationUrl metadata
instead of being re-logged as plain text.

Pathways:
- LookupInvoker: settings validation problems
- MavenInvoker: toolchains validation problems
- DefaultProjectsSelector: model validation problems (ModelProblem → BuilderProblem)
- DefaultMaven: graph building problems (ModelProblem → BuilderProblem)

Also adds EXCLUDED_LOGGERS in BuildReportCollector to prevent double-counting
when the same problems are both piped structurally and logged via SLF4J.

Migrates all test files from DefaultBuilderProblem constructor to
BuilderProblem.builder() API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change the PluginValidationManager interface from String-based to
BuilderProblem-based, enabling structured problem reporting with keys,
severity, and suggestions throughout the plugin validation pipeline.

- Change 3 abstract report methods from String issue to BuilderProblem
- Add deprecated String-based default methods for backward compat
- Update all 9 call sites (7 validators + 1 plugin manager) to create
  BuilderProblem with structured key, severity, and suggestion
- Inject DefaultDiagnosticCollector into DefaultPluginValidationManager
  to pipe problems into the diagnostic pipeline
- Add japicmp exclusion for the intentional API break
- Add DefaultPluginValidationManager to EXCLUDED_LOGGERS in
  BuildReportCollector to prevent double-counting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the feature/12643-structured-problems branch from dbf0ac6 to 84d77ae Compare August 8, 2026 21:57
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