Skip to content

Filter dependencies with uninterpolated expressions from CollectRequest#12179

Closed
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:fix/null-dependency-collect-request
Closed

Filter dependencies with uninterpolated expressions from CollectRequest#12179
gnodet wants to merge 1 commit into
apache:masterfrom
gnodet:fix/null-dependency-collect-request

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 28, 2026

Summary

  • Filter dependencies and managed dependencies with uninterpolated ${...} property expressions before passing them to CollectRequest, preventing MavenValidator from rejecting the entire request with "Invalid Collect Request"
  • Apply filtering in both DefaultProjectDependenciesResolver (Maven 3 compat path) and DefaultDependencyResolver (Maven 4 API path), consistent with what DefaultArtifactDescriptorReader already does for transitive dependencies
  • Improve error enhancement in DefaultDependencyResolver.enhanceCollectionError() to also check managed dependencies for unresolved expressions

Test plan

  • Unit tests for filterUninterpolated() covering placeholder in version/groupId/artifactId, valid deps pass-through, null and empty input, containsPlaceholder edge cases
  • All maven-impl tests pass (475 tests)
  • All maven-core tests pass (549 tests, 1 pre-existing skip)
  • Verify with affected projects (causeway-app-helloworld, activemq-openwire, mina-sshd, etc.)

Claude Code on behalf of Guillaume Nodet

🤖 Generated with Claude Code

When building a CollectRequest for dependency collection, dependencies
and managed dependencies with uninterpolated ${...} property expressions
would cause MavenValidator to reject the entire request with "Invalid
Collect Request". This commonly happens with managed dependencies
imported from BOMs that define properties not resolvable in the
importing project's context.

The transitive path (DefaultArtifactDescriptorReader) already filtered
these, but the direct project paths did not. Apply the same filtering
in both DefaultProjectDependenciesResolver (Maven 3 compat) and
DefaultDependencyResolver (Maven 4 API), and also improve the error
enhancement to check managed dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet added a commit that referenced this pull request May 28, 2026
…st (PR #12179)

Cherry-pick from fix/null-dependency-collect-request branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet added this to the 4.0.0-rc-6 milestone May 28, 2026
@gnodet
Copy link
Copy Markdown
Contributor Author

gnodet commented May 29, 2026

Claude Code on behalf of Guillaume Nodet

Closing this PR. Investigation showed the original "Invalid Collect Request" failures were caused by uninterpolated repository expressions, not dependency expressions. Those were already fixed by #12050 and #12047. Uninterpolated managed dependencies are not a problem unless actually used, and BOM model building interpolates dependency properties correctly.

@gnodet gnodet closed this May 29, 2026
@github-actions github-actions Bot removed this from the 4.0.0-rc-6 milestone May 29, 2026
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