Package org.apache.maven.api.services
Class DependencyResolverRequest.DependencyResolverRequestBuilder
java.lang.Object
org.apache.maven.api.services.DependencyCollectorRequest.DependencyCollectorRequestBuilder
org.apache.maven.api.services.DependencyResolverRequest.DependencyResolverRequestBuilder
- Enclosing interface:
DependencyResolverRequest
@NotThreadSafe
public static class DependencyResolverRequest.DependencyResolverRequestBuilder
extends DependencyCollectorRequest.DependencyCollectorRequestBuilder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
dependencies
(List<DependencyCoordinate> dependencies) Sets the direct dependencies.dependency
(DependencyCoordinate dependency) Adds the specified direct dependency.managedDependencies
(List<DependencyCoordinate> managedDependencies) Sets the dependency management to apply to transitive dependencies.managedDependency
(DependencyCoordinate managedDependency) Adds the specified managed dependency.pathTypeFilter
(Collection<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.root
(DependencyCoordinate root) rootArtifact
(Artifact rootArtifact) Sets the root artifact for the dependency graph.verbose
(boolean verbose) Specifies that the collection should be verbose.
-
Constructor Details
-
DependencyResolverRequestBuilder
public DependencyResolverRequestBuilder()
-
-
Method Details
-
session
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder session(@Nonnull Session session) - Overrides:
session
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
-
project
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder project(@Nullable Project project) - Overrides:
project
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
-
rootArtifact
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder rootArtifact(@Nullable Artifact rootArtifact) Description copied from class:DependencyCollectorRequest.DependencyCollectorRequestBuilder
Sets the root artifact for the dependency graph. This must not be confused withDependencyCollectorRequest.DependencyCollectorRequestBuilder.root(DependencyCoordinate)
: 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 ifDependencyCollectorRequest.DependencyCollectorRequestBuilder.root(DependencyCoordinate)
has been set.- Overrides:
rootArtifact
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
- Parameters:
rootArtifact
- the root artifact for the dependency graph, may benull
- Returns:
- this request for chaining, never
null
-
root
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder root(@Nullable DependencyCoordinate root) - Overrides:
root
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
- Parameters:
root
- The root dependency- Returns:
- this request for chaining, never
null
-
dependencies
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder dependencies(@Nullable List<DependencyCoordinate> dependencies) Description copied from class:DependencyCollectorRequest.DependencyCollectorRequestBuilder
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.- Overrides:
dependencies
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
- Parameters:
dependencies
- the direct dependencies, may benull
- Returns:
- this request for chaining, never
null
-
dependency
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder dependency(@Nullable DependencyCoordinate dependency) Description copied from class:DependencyCollectorRequest.DependencyCollectorRequestBuilder
Adds the specified direct dependency.- Overrides:
dependency
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
- Parameters:
dependency
- the dependency to add, may benull
- Returns:
- this request for chaining, never
null
-
managedDependencies
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder managedDependencies(@Nullable List<DependencyCoordinate> managedDependencies) Description copied from class:DependencyCollectorRequest.DependencyCollectorRequestBuilder
Sets the dependency management to apply to transitive dependencies. To clarify, this management does not apply to the direct dependencies of the root node.- Overrides:
managedDependencies
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
- Parameters:
managedDependencies
- the dependency management, may benull
- Returns:
- this request for chaining, never
null
-
managedDependency
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder managedDependency(@Nullable DependencyCoordinate managedDependency) Description copied from class:DependencyCollectorRequest.DependencyCollectorRequestBuilder
Adds the specified managed dependency.- Overrides:
managedDependency
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
- 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
Description copied from class:DependencyCollectorRequest.DependencyCollectorRequestBuilder
Specifies that the collection should be verbose.- Overrides:
verbose
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
- Parameters:
verbose
- whether the collection should be verbose or not- Returns:
- this request for chaining, never
null
-
pathScope
@Nonnull public DependencyResolverRequest.DependencyResolverRequestBuilder pathScope(@Nonnull 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<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
- Overrides:
build
in classDependencyCollectorRequest.DependencyCollectorRequestBuilder
-