Apache Software Foundation / Maven Core
Merged upstreamCorrectnessMerged Sep 1, 2026

Report BOM import warnings only at declaration sites

Changed Maven model building to associate conflicting BOM warnings with their declaration source and deduplicate them within each top-level build.

apache/maven · #12959

Build diagnostics improvement

Conflicting BOM import warnings now appear once where the imports are declared instead of repeating for every inheriting module.

Problem

A BOM conflict declared in a parent model could be reported again for every inheriting child, flooding large reactor logs and attributing the warning to modules that did not declare the imports.

Approach

Preserves each imported dependency-management source location, routes the warning to the declaring model's collector, and deduplicates by declaration location and message through concurrent constant-time lookup. Diagnostic state resets between independent builds and reactor-root fallback.

Impact and scope

  • Makes dependency-management diagnostics actionable by pointing developers to the model that actually declares the conflict.
  • Prevents warning volume from scaling with the number of inheriting modules in large serial or parallel reactors.
  • Preserves independent declarations, non-reactor parents, CI-friendly versions, and profile-sensitive model contexts.

Validation

  • Added coverage for serial and parallel reactors, repeated sessions, profiles, independent declarations, and non-reactor parents.
  • Passed 613 Maven implementation tests, 27 focused model-builder tests, full verification, and the complete upstream multi-OS/JDK build and integration matrix.
  • The authored implementation and GitHub-verified merge commit credit Goutam Adwant; the merge closed MNG-8450.