Package org.apache.maven.api.services
Interface DependencyResolver
- All Superinterfaces:
Service
- All Known Implementing Classes:
DefaultDependencyResolver
Collects, flattens and resolves dependencies.
-
Method Summary
Modifier and TypeMethodDescriptiondefault DependencyResolverResult
collect
(DependencyResolverRequest request) Collects the transitive dependencies and builds a dependency graph.default DependencyResolverResult
Collects the transitive dependencies of some artifacts and builds a dependency graph for the given path scope.default DependencyResolverResult
collect
(Session session, DependencyCoordinates root, PathScope scope) Collects the transitive dependencies of some artifacts and builds a dependency graph for the given path scope.default DependencyResolverResult
Collects the transitive dependencies of some artifacts and builds a dependency graph for the given path scope.default DependencyResolverResult
flatten
(DependencyResolverRequest request) Flattens a list of nodes.default DependencyResolverResult
resolve
(DependencyResolverRequest request) This method collects, flattens and resolves the dependencies.default DependencyResolverResult
resolve
(Session session, List<DependencyCoordinates> dependencies) default DependencyResolverResult
resolve
(Session session, List<DependencyCoordinates> dependencies, PathScope scope) default DependencyResolverResult
resolve
(Session session, DependencyCoordinates dependency) default DependencyResolverResult
resolve
(Session session, DependencyCoordinates dependency, PathScope scope) default DependencyResolverResult
default DependencyResolverResult
-
Method Details
-
collect
@Nonnull default DependencyResolverResult collect(@Nonnull Session session, @Nonnull DependencyCoordinates root, @Nonnull PathScope scope) Collects the transitive dependencies of some artifacts and builds a dependency graph for the given path scope. Note that this operation is only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the artifact files.- Parameters:
session
- theSession
, must not benull
root
- the Maven Dependency, must not benull
scope
- the {link PathScope} to collect dependencies, 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:
-
collect
@Nonnull default DependencyResolverResult collect(@Nonnull Session session, @Nonnull Project project, @Nonnull PathScope scope) Collects the transitive dependencies of some artifacts and builds a dependency graph for the given path scope. Note that this operation is only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the artifact files.- Parameters:
session
- theSession
, must not benull
project
- theProject
, must not benull
scope
- the {link PathScope} to collect dependencies, 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:
-
collect
@Nonnull default DependencyResolverResult collect(@Nonnull Session session, @Nonnull Artifact artifact, @Nonnull PathScope scope) Collects the transitive dependencies of some artifacts and builds a dependency graph for the given path scope. Note that this operation is only concerned about determining the coordinates of the transitive dependencies and does not actually resolve the artifact files.- Parameters:
session
- theSession
, must not benull
artifact
- theArtifact
, must not benull
scope
- the {link PathScope} to collect dependencies, 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:
-
collect
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.- 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
List<Node> flatten(@Nonnull Session session, @Nonnull Node node, @Nullable PathScope scope) throws DependencyResolverException 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.- Parameters:
session
- 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
-
flatten
-
flatten
-
resolve
-
resolve
-
resolve
@Nonnull default DependencyResolverResult resolve(@Nonnull Session session, @Nonnull DependencyCoordinates dependency) -
resolve
@Nonnull default DependencyResolverResult resolve(@Nonnull Session session, @Nonnull DependencyCoordinates dependency, @Nonnull PathScope scope) -
resolve
@Nonnull default DependencyResolverResult resolve(@Nonnull Session session, @Nonnull List<DependencyCoordinates> dependencies) -
resolve
@Nonnull default DependencyResolverResult resolve(@Nonnull Session session, @Nonnull List<DependencyCoordinates> dependencies, @Nonnull PathScope scope) -
resolve
DependencyResolverResult resolve(DependencyResolverRequest request) throws DependencyResolverException, ArtifactResolverException This method collects, flattens and resolves the dependencies.- Parameters:
request
- the request to resolve- Returns:
- the result of the resolution
- Throws:
DependencyResolverException
ArtifactResolverException
- See Also:
-