Skip to content

[Backport 4.0.x] Fix #12531: filter NO_REPOSITORY sentinel from mapped exceptions in ArtifactResolverResult - #12561

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12533-no-repository-sentinel
Jul 28, 2026
Merged

[Backport 4.0.x] Fix #12531: filter NO_REPOSITORY sentinel from mapped exceptions in ArtifactResolverResult#12561
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12533-no-repository-sentinel

Conversation

@gnodet

@gnodet gnodet commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

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

…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 gnodet added this to the 4.0.0-rc-6 milestone Jul 28, 2026

@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 cherry-pick of a well-scoped bugfix from master to 4.0.x. The fix correctly addresses two bugs:

  1. NO_REPOSITORY sentinel leaking as null key into the exceptions map, causing IllegalArgumentException in downstream plugins
  2. Vacuous-truth bug where an empty exception list would cause isMissing() to return true (since allMatch on 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
@gnodet
gnodet merged commit cff0b0d into maven-4.0.x Jul 28, 2026
24 checks passed
@gnodet
gnodet deleted the backport/12533-no-repository-sentinel branch July 28, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant