public final class CollectRequest extends Object
DependencyCollector.collectDependencies(org.apache.maven.project.ProjectBuildingRequest, org.apache.maven.model.Dependency)
,
DependencyCollector.collectDependencies(org.apache.maven.project.ProjectBuildingRequest, org.apache.maven.shared.transfer.dependencies.DependableCoordinate)
,
DependencyCollector.collectDependencies(org.apache.maven.project.ProjectBuildingRequest, org.apache.maven.model.Model)
Constructor and Description |
---|
CollectRequest()
Creates an uninitialized request.
|
CollectRequest(org.apache.maven.model.Dependency root,
List<ArtifactRepository> repositories)
Creates a request with the specified properties.
|
CollectRequest(org.apache.maven.model.Dependency root,
List<org.apache.maven.model.Dependency> dependencies,
List<ArtifactRepository> repositories)
Creates a new request with the specified properties.
|
CollectRequest(List<org.apache.maven.model.Dependency> dependencies,
List<org.apache.maven.model.Dependency> managedDependencies,
List<ArtifactRepository> repositories)
Creates a new request with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
CollectRequest |
addDependency(org.apache.maven.model.Dependency dependency)
Adds the specified direct dependency.
|
CollectRequest |
addManagedDependency(org.apache.maven.model.Dependency managedDependency)
Adds the specified managed dependency.
|
CollectRequest |
addRepository(ArtifactRepository repository)
Adds the specified repository for collection.
|
List<org.apache.maven.model.Dependency> |
getDependencies()
Gets the direct dependencies.
|
List<org.apache.maven.model.Dependency> |
getManagedDependencies()
Gets the dependency management to apply to transitive dependencies.
|
List<ArtifactRepository> |
getRepositories()
Gets the repositories to use for the collection.
|
org.apache.maven.model.Dependency |
getRoot()
Gets the root dependency of the graph.
|
Artifact |
getRootArtifact()
Gets the root artifact for the dependency graph.
|
CollectRequest |
setDependencies(List<org.apache.maven.model.Dependency> dependencies)
Sets the direct dependencies.
|
CollectRequest |
setManagedDependencies(List<org.apache.maven.model.Dependency> managedDependencies)
Sets the dependency management to apply to transitive dependencies.
|
CollectRequest |
setRepositories(List<ArtifactRepository> repositories)
Sets the repositories to use for the collection.
|
CollectRequest |
setRoot(org.apache.maven.model.Dependency root)
Sets the root dependency of the graph.
|
CollectRequest |
setRootArtifact(Artifact rootArtifact)
Sets the root artifact for the dependency graph.
|
String |
toString() |
public CollectRequest()
public CollectRequest(org.apache.maven.model.Dependency root, List<ArtifactRepository> repositories)
root
- The root dependency whose transitive dependencies should be collected, may be null
.repositories
- The repositories to use for the collection, may be null
.public CollectRequest(org.apache.maven.model.Dependency root, List<org.apache.maven.model.Dependency> dependencies, List<ArtifactRepository> repositories)
root
- The root dependency whose transitive dependencies should be collected, may be null
.dependencies
- The direct dependencies to merge with the direct dependencies from the root dependency's
artifact descriptor.repositories
- The repositories to use for the collection, may be null
.public CollectRequest(List<org.apache.maven.model.Dependency> dependencies, List<org.apache.maven.model.Dependency> managedDependencies, List<ArtifactRepository> repositories)
dependencies
- The direct dependencies of some imaginary root, may be null
.managedDependencies
- The dependency management information to apply to the transitive dependencies, may be
null
.repositories
- The repositories to use for the collection, may be null
.public Artifact getRootArtifact()
null
if none.public CollectRequest setRootArtifact(Artifact rootArtifact)
setRoot(Dependency)
: 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 if getRoot()
does not return
null
.rootArtifact
- The root artifact for the dependency graph, may be null
.null
.public org.apache.maven.model.Dependency getRoot()
null
if none.public CollectRequest setRoot(org.apache.maven.model.Dependency root)
root
- The root dependency of the graph, may be null
.null
.public List<org.apache.maven.model.Dependency> getDependencies()
null
.public CollectRequest setDependencies(List<org.apache.maven.model.Dependency> dependencies)
dependencies
- The direct dependencies, may be null
.null
.public CollectRequest addDependency(org.apache.maven.model.Dependency dependency)
dependency
- The dependency to add, may be null
.null
.public List<org.apache.maven.model.Dependency> getManagedDependencies()
null
.public CollectRequest setManagedDependencies(List<org.apache.maven.model.Dependency> managedDependencies)
managedDependencies
- The dependency management, may be null
.null
.public CollectRequest addManagedDependency(org.apache.maven.model.Dependency managedDependency)
managedDependency
- The managed dependency to add, may be null
.null
.public List<ArtifactRepository> getRepositories()
null
.public CollectRequest setRepositories(List<ArtifactRepository> repositories)
repositories
- The repositories to use for the collection, may be null
.null
.public CollectRequest addRepository(ArtifactRepository repository)
repository
- The repository to collect dependency information from, may be null
.null
.Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.