maven-resolver question: difference between DependencySelector and DependencyFilter?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

maven-resolver question: difference between DependencySelector and DependencyFilter?

ljnelson
Hello:

DependencySelector (
https://maven.apache.org/resolver/apidocs/org/eclipse/aether/collection/DependencySelector.html)
has Javadocs that read (in part): "Decides what dependencies to include in
the dependency graph".

DependencyFilter (
https://maven.apache.org/resolver/apidocs/org/eclipse/aether/graph/DependencyFilter.html)
has Javadocs that read (in part): "A filter to include/exclude dependency
nodes during other operations.".

A DependencySelector is something that is set onto a
RepositorySystemSession and is "called from a hotspot" (i.e. it is central
to how the RepositorySystemSession works).  DependencyFilter is something
that is supplied to (probably among other things) a DependencyRequest (
https://maven.apache.org/resolver/apidocs/org/eclipse/aether/resolution/DependencyRequest.html#DependencyRequest(org.eclipse.aether.collection.CollectRequest,%20org.eclipse.aether.graph.DependencyFilter
).

I'm noticing that when I rely on the default DependencySelector installed
by MavenRepositorySystemUtils#newSession(), which incorporates optionality,
scope, etc., I still get optional dependencies in my collected results.
Shouldn't the session's DependencySelector take care of eliminating
optional dependencies when I ask maven-resolver to resolve my dependencies?

Best,
Laird
Reply | Threaded
Open this post in threaded view
|

Re: maven-resolver question: difference between DependencySelector and DependencyFilter?

ljnelson
On Mon, Feb 26, 2018 at 5:46 PM Laird Nelson <[hidden email]> wrote:

> I'm noticing that when I rely on the default DependencySelector installed
> by MavenRepositorySystemUtils#newSession(), which incorporates optionality,
> scope, etc., I still get optional dependencies in my collected results.
>

I meant to include the javadoc reference in my previous message:
http://maven.apache.org/ref/3.3.9/maven-aether-provider/apidocs/org/apache/maven/repository/internal/MavenRepositorySystemUtils.html#newSession
()

Best,
Laird