GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Test the depth semantics of the impl scope and optional selectors by slachiewicz · Pull Request #2288 · apache/maven-resolver

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 7, 2026

Copy link
Copy Markdown
Member

Fixes #784. The issue asked for tests of ScopeDependencySelector and OptionalDependencySelector in maven-resolver-util; the test classes that exist there only cover toString(), and both classes are now deprecated in favour of the same-named classes in org.eclipse.aether.internal.impl.scope, which had no tests at all. The new tests therefore cover the impl classes.

What they pin down is the depth model, which is the part the Javadoc states and nothing exercised directly: the session selector sits above the root, each deriveChildSelector moves one level down, fromRoot filters from the first level while fromDirect keeps direct dependencies of any scope (or optional), fromTo stops applying beyond the upper bound, and legacy shifts a level only when collection starts from an artifact rather than a dependency, which is the Resolver 1.x behaviour. For the optional selector the two session-data hooks are covered: IGNORED_KEYS exempts an artifact, UNSELECTED_KEYS collects the ids that were dropped. The equality tests check the "starting state" note in both classes: two selectors at the same depth with the same configuration are still unequal when they got there from different starting points.

No change to 1.9.x: the util classes there are the live ones and their tests are JUnit 4.

Verified: mvn -pl maven-resolver-impl -am test -Dtest=ScopeDependencySelectorTest,OptionalDependencySelectorTest on JDK 21 → 9 + 6 tests, 0 failures; spotless:apply left the files unchanged.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@slachiewicz
Test the depth semantics of the impl scope and optional selectors
6eda368
@slachiewicz slachiewicz added the maintenance label Nov 7, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 7, 2026 22:14
@slachiewicz slachiewicz mentioned this pull request Nov 14, 2026
Maven 4 API gaps for plugin authors without an issue apache/maven#14001
Open
13 tasks
@cstamas cstamas added this to the 2.0.26 milestone Nov 16, 2026
@cstamas
cstamas merged commit 1097437 into master Nov 16, 2026
20 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@cstamas
cstamas deleted the agent/scope-selector-tests branch November 16, 2026 19:40
@github-actions github-actions Bot assigned cstamas Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cstamas cstamas

Labels

maintenance

Projects

None yet

Milestone

2.0.26

Development

Successfully merging this pull request may close these issues.

[MRESOLVER-12] Addition of unit tests for DependencySelector implementations

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@slachiewicz @cstamas
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.