Package org.apache.maven.internal.impl
Class DefaultDependencyResolver
java.lang.Object
org.apache.maven.internal.impl.DefaultDependencyResolver
- All Implemented Interfaces:
Service
,DependencyResolver
@Named
@Singleton
public class DefaultDependencyResolver
extends Object
implements DependencyResolver
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncollect
(DependencyResolverRequest request) Collects the transitive dependencies and builds a dependency graph.Flattens a list of nodes.resolve
(DependencyResolverRequest request) Collects, flattens and resolves the dependencies.
-
Constructor Details
-
DefaultDependencyResolver
public DefaultDependencyResolver()
-
-
Method Details
-
collect
@Nonnull public DependencyResolverResult collect(@Nonnull DependencyResolverRequest request) throws DependencyResolverException, IllegalArgumentException Description copied from interface:DependencyResolver
Collects the transitive dependencies and builds a dependency graph. Note that this operation is only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the artifact files.- Specified by:
collect
in interfaceDependencyResolver
- Parameters:
request
- the dependency collection request, must not benull
- Returns:
- the collection result, never
null
- Throws:
DependencyResolverException
- if the dependency tree could not be builtIllegalArgumentException
- if an argument is null or invalid- See Also:
-
flatten
@Nonnull public List<Node> flatten(@Nonnull Session s, @Nonnull Node node, @Nullable PathScope scope) throws DependencyResolverException Description copied from interface:DependencyResolver
Flattens a list of nodes. Note that thePathScope
argument should usually be null as the dependency tree has been filtered during collection for the appropriate scope.- Specified by:
flatten
in interfaceDependencyResolver
- Parameters:
s
- theSession
, must not benull
node
- theNode
to flatten, must not benull
scope
- an optionalPathScope
to filter out dependencies- Returns:
- the flattened list of node
- Throws:
DependencyResolverException
-
resolve
public DependencyResolverResult resolve(DependencyResolverRequest request) throws DependencyResolverException, DependencyResolverException, ArtifactResolverException Collects, flattens and resolves the dependencies.- Specified by:
resolve
in interfaceDependencyResolver
- Parameters:
request
- the request to resolve- Returns:
- the result of the resolution
- Throws:
DependencyResolverException
ArtifactResolverException
- See Also:
-