[Backport 4.0.x] Fix #12531: filter NO_REPOSITORY sentinel from mapped exceptions in ArtifactResolverResult - #12561
Merged
Conversation
…rtifactResolverResult Plugins that resolve dependencies (cyclonedx-maven-plugin, camel-spring-boot-generator) threw IllegalArgumentException because ArtifactResult.NO_REPOSITORY sentinel leaked as a null key in the exceptions map exposed through ResultItem.getExceptions(). Filter out NO_REPOSITORY entries from the mapped exceptions while preserving all exceptions in a flat allExceptions list so isMissing() still considers them. Also fixes vacuous-truth bug where an empty exception list was treated as "all exceptions are ArtifactNotFoundException". Closes #12533
gnodet
commented
Jul 28, 2026
gnodet
left a comment
Contributor
Author
There was a problem hiding this comment.
✅ Clean cherry-pick of a well-scoped bugfix from master to 4.0.x. The fix correctly addresses two bugs:
- NO_REPOSITORY sentinel leaking as null key into the exceptions map, causing
IllegalArgumentExceptionin downstream plugins - Vacuous-truth bug where an empty exception list would cause
isMissing()to return true (sinceallMatchon an empty stream returns true)
The cherry-pick is identical to the original commit — verified by diffing both commits' changes. Good use of merge() instead of Collectors.toMap() for robustness against duplicate keys, and Map.copyOf()/List.copyOf() for defensive immutability. Test coverage is solid with 4 comprehensive unit tests.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
gnodet
added a commit
to gnodet/maven
that referenced
this pull request
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #12533 to
maven-4.0.x.Cherry-pick of 6676d1b — clean, no conflicts.
Plugins that resolve dependencies (cyclonedx-maven-plugin,
camel-spring-boot-generator) threw IllegalArgumentException because
ArtifactResult.NO_REPOSITORY sentinel leaked as a null key in the
exceptions map. Filters out NO_REPOSITORY entries while preserving
all exceptions for isMissing() checks.
Original PR: #12533
Closes #12531