Package org.apache.maven.api.services
Class DependencyResolverRequest.DependencyResolverRequestBuilder
java.lang.Object
org.apache.maven.api.services.DependencyResolverRequest.DependencyResolverRequestBuilder
- Enclosing interface:
DependencyResolverRequest
@NotThreadSafe
public static class DependencyResolverRequest.DependencyResolverRequestBuilder
extends Object
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
dependencies
(List<DependencyCoordinates> dependencies) Sets the direct dependencies.dependency
(DependencyCoordinates dependency) Adds the specified direct dependency.managedDependencies
(List<DependencyCoordinates> managedDependencies) Sets the dependency management to apply to transitive dependencies.managedDependency
(DependencyCoordinates managedDependency) Adds the specified managed dependency.pathTypeFilter
(Collection<? extends PathType> desiredTypes) Specifies the type of paths to include in the result.pathTypeFilter
(Predicate<PathType> pathTypeFilter) Filters the types of paths to include in the result.requestType
(DependencyResolverRequest.RequestType requestType) root
(DependencyCoordinates root) rootArtifact
(Artifact rootArtifact) Sets the root artifact for the dependency graph.verbose
(boolean verbose) Specifies that the collection should be verbose.
-
Method Details
-
session
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder session(@Nonnull Session session) -
requestType
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder requestType(@Nonnull DependencyResolverRequest.RequestType requestType) -
project
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder project(@Nullable Project project) -
rootArtifact
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder rootArtifact(@Nullable Artifact rootArtifact) Sets the root artifact for the dependency graph. This must not be confused withroot(DependencyCoordinates)
: The root dependency, like any other specified dependency, will be subject to dependency collection/resolution, i.e. should have an artifact descriptor and a corresponding artifact file. The root artifact on the other hand is only used as a label for the root node of the graph in case no root dependency was specified. As such, the configured root artifact is ignored ifroot(DependencyCoordinates)
has been set.- Parameters:
rootArtifact
- the root artifact for the dependency graph, may benull
- Returns:
- this request for chaining, never
null
-
root
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder root(@Nonnull DependencyCoordinates root) - Parameters:
root
- The root dependency- Returns:
- this request for chaining, never
null
-
dependencies
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder dependencies(@Nullable List<DependencyCoordinates> dependencies) Sets the direct dependencies. If both a root dependency and direct dependencies are given in the request, the direct dependencies from the request will be merged with the direct dependencies from the root dependency's artifact descriptor, giving higher priority to the dependencies from the request.- Parameters:
dependencies
- the direct dependencies, may benull
- Returns:
- this request for chaining, never
null
-
dependency
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder dependency(@Nullable DependencyCoordinates dependency) Adds the specified direct dependency.- Parameters:
dependency
- the dependency to add, may benull
- Returns:
- this request for chaining, never
null
-
managedDependencies
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder managedDependencies(@Nullable List<DependencyCoordinates> managedDependencies) Sets the dependency management to apply to transitive dependencies. To clarify, this management does not apply to the direct dependencies of the root node.- Parameters:
managedDependencies
- the dependency management, may benull
- Returns:
- this request for chaining, never
null
-
managedDependency
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder managedDependency(@Nullable DependencyCoordinates managedDependency) Adds the specified managed dependency.- Parameters:
managedDependency
- The managed dependency to add, may benull
in which case the call will have no effect.- Returns:
- this request for chaining, never
null
-
verbose
Specifies that the collection should be verbose.- Parameters:
verbose
- whether the collection should be verbose or not- Returns:
- this request for chaining, never
null
-
pathScope
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder pathScope(@Nullable PathScope pathScope) -
pathTypeFilter
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder pathTypeFilter(@Nonnull Predicate<PathType> pathTypeFilter) Filters the types of paths to include in the result. The result will contain only the paths of types for which the predicate returnedtrue
. It is recommended to apply a filter for retaining only the types of paths of interest, because it can resolve ambiguities when a path could be of many types.- Parameters:
pathTypeFilter
- predicate evaluating whether a path type should be included in the result- Returns:
this
for method call chaining
-
pathTypeFilter
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder pathTypeFilter(@Nonnull Collection<? extends PathType> desiredTypes) Specifies the type of paths to include in the result. This is a convenience method forpathTypeFilter(Predicate)
usingCollection.contains(Object)
as the filter.- Parameters:
desiredTypes
- the type of paths to include in the result- Returns:
this
for method call chaining
-
build
-