Sitelet https://github.com/apache/maven/pull/13003
Skip to content

[MNG-8450] Report BOM import warnings only at declaration sites (4.0.x backport) - #13003

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12959-to-maven-4.0.x
Sep 1, 2026
Merged

gnodet merged 1 commit into
maven-4.0.xfrom
backport/12959-to-maven-4.0.x

Conversation

@gnodet

@gnodet gnodet commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Backport of #12959 to maven-4.0.x (squash-merged to master as 625d69d).

Report conflicting BOM import warnings once at the model that declares the imports instead of repeating them for every inheriting child.

Cherry-pick details

Single squash commit cherry-picked from master with conflict resolution:

  • Dropped master-only imports (Spliterator, CountDownLatch, ExecutorService, Executors, Future, TimeUnit, ModelSource) not needed on 4.0.x
  • Added Constants import (already available in 4.0.x, referenced by test)

Test plan

  • DefaultModelBuilderTest — 24 tests passed (including 3 new MNG-8450 tests)
  • Compilation verified on maven-4.0.x base

🤖 Generated with Claude Code

@gnodet gnodet added this to the 4.0.0-rc-7 milestone Sep 1, 2026
@gnodet gnodet added the bug Something isn't working label Sep 1, 2026
* [MNG-8450] Report BOM import warnings only at declaration sites

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>

* [MNG-8450] Handle import warnings without source locations

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>

* [MNG-8450] Address review feedback: polish deduplication code

- Import java.util.stream.Collectors instead of using fully-qualified references
- Add Javadoc on ImportWarningKey record explaining its deduplication role
- Document dual-key rationale in registerReactorProblemCollector
- Extract anonymous ModelProblemCollector to named DeduplicatingImportProblemCollector inner class

Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added the enhancement New feature or request label Sep 1, 2026
@gnodet
gnodet force-pushed the backport/12959-to-maven-4.0.x branch from 166d83b to 8eae5c6 Compare September 1, 2026 15:10

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Clean, faithful cherry-pick of #12959 to maven-4.0.x. No issues found.

Cherry-pick verification:

  • All production code changes in DefaultModelBuilder.java and DefaultDependencyManagementImporter.java match the master commit (625d69d92a) exactly.
  • Import conflict resolution is correct: master-only imports (Spliterator, CountDownLatch, ExecutorService, etc.) correctly omitted; Constants import correctly added for the test.
  • All 15 test fixture POM files and 3 test methods are identical to master.

Polish from master review addressed: All four non-blocking suggestions from the #12959 review were incorporated:

  1. ✅ Collectors properly imported (no longer fully-qualified)
  2. ✅ ImportWarningKey has Javadoc
  3. ✅ registerReactorProblemCollector has dual-key rationale comment
  4. ✅ Anonymous collector extracted to named DeduplicatingImportProblemCollector inner class

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

@gnodet
gnodet merged commit 0ede700 into maven-4.0.x Sep 1, 2026
23 checks passed
@gnodet
gnodet deleted the backport/12959-to-maven-4.0.x branch September 1, 2026 16:33
@gnodet gnodet removed the enhancement New feature or request label Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants