Class DefaultDependencyCollector
- java.lang.Object
-
- org.apache.maven.shared.transfer.collection.internal.DefaultDependencyCollector
-
- All Implemented Interfaces:
DependencyCollector
,org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
@Component(role=DependencyCollector.class, hint="default") class DefaultDependencyCollector extends java.lang.Object implements DependencyCollector, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
This DependencyCollector passes the request to the proper Maven 3.x implementation
-
-
Field Summary
Fields Modifier and Type Field Description private org.codehaus.plexus.PlexusContainer
container
-
Constructor Summary
Constructors Constructor Description DefaultDependencyCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollectResult
collectDependencies(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Dependency root)
Collects the transitive dependencies of some artifacts and builds a dependency graph.CollectResult
collectDependencies(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Model root)
Collects the transitive dependencies of some artifacts and builds a dependency graph.CollectResult
collectDependencies(org.apache.maven.project.ProjectBuildingRequest buildingRequest, DependableCoordinate root)
Collects the transitive dependencies of some artifacts and builds a dependency graph.void
contextualize(org.codehaus.plexus.context.Context context)
Injects the Plexus content.private MavenDependencyCollector
getMavenDependencyCollector(org.apache.maven.project.ProjectBuildingRequest buildingRequest)
private boolean
isMaven31()
private void
validateBuildingRequest(org.apache.maven.project.ProjectBuildingRequest buildingRequest)
private void
validateBuildingRequestAndRoot(org.apache.maven.project.ProjectBuildingRequest buildingRequest, java.lang.Object root)
private void
validateParameters(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Dependency root)
private void
validateParameters(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Model root)
private void
validateParameters(org.apache.maven.project.ProjectBuildingRequest buildingRequest, DependableCoordinate root)
private void
validateRoot(java.lang.Object root)
-
-
-
Method Detail
-
collectDependencies
public CollectResult collectDependencies(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Dependency root) throws DependencyCollectionException
Description copied from interface:DependencyCollector
Collects the transitive dependencies of some artifacts 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. The supplied session carries various hooks to customize the dependency graph that must be invoked throughout the operation.- Specified by:
collectDependencies
in interfaceDependencyCollector
- Parameters:
buildingRequest
- The Maven project buildingrequest, must not benull
.root
- The Maven Dependency, must not benull
.- Returns:
- The collection result, never
null
. - Throws:
DependencyCollectionException
- If the dependency tree could not be built.
-
collectDependencies
public CollectResult collectDependencies(org.apache.maven.project.ProjectBuildingRequest buildingRequest, DependableCoordinate root) throws DependencyCollectionException
Description copied from interface:DependencyCollector
Collects the transitive dependencies of some artifacts 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. The supplied session carries various hooks to customize the dependency graph that must be invoked throughout the operation.- Specified by:
collectDependencies
in interfaceDependencyCollector
- Parameters:
buildingRequest
- The Maven project buildingrequest, must not benull
.root
- The Maven DependableCoordinate, must not benull
.- Returns:
- The collection result, never
null
. - Throws:
DependencyCollectionException
- If the dependency tree could not be built.
-
collectDependencies
public CollectResult collectDependencies(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Model root) throws DependencyCollectionException
Description copied from interface:DependencyCollector
Collects the transitive dependencies of some artifacts 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. The supplied session carries various hooks to customize the dependency graph that must be invoked throughout the operation.- Specified by:
collectDependencies
in interfaceDependencyCollector
- Parameters:
buildingRequest
- The Maven project buildingrequest, must not benull
.root
- The Maven model, must not benull
.- Returns:
- The collection result, never
null
. - Throws:
DependencyCollectionException
- If the dependency tree could not be built.
-
validateParameters
private void validateParameters(org.apache.maven.project.ProjectBuildingRequest buildingRequest, DependableCoordinate root)
-
validateParameters
private void validateParameters(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Dependency root)
-
validateParameters
private void validateParameters(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Model root)
-
validateBuildingRequestAndRoot
private void validateBuildingRequestAndRoot(org.apache.maven.project.ProjectBuildingRequest buildingRequest, java.lang.Object root)
-
validateBuildingRequest
private void validateBuildingRequest(org.apache.maven.project.ProjectBuildingRequest buildingRequest)
-
validateRoot
private void validateRoot(java.lang.Object root)
-
isMaven31
private boolean isMaven31()
- Returns:
- true if the current Maven version is Maven 3.1.
-
contextualize
public void contextualize(org.codehaus.plexus.context.Context context) throws org.codehaus.plexus.context.ContextException
Injects the Plexus content.- Specified by:
contextualize
in interfaceorg.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
- Parameters:
context
- Plexus context to inject.- Throws:
org.codehaus.plexus.context.ContextException
- if the PlexusContainer could not be located.
-
getMavenDependencyCollector
private MavenDependencyCollector getMavenDependencyCollector(org.apache.maven.project.ProjectBuildingRequest buildingRequest) throws org.codehaus.plexus.component.repository.exception.ComponentLookupException, DependencyCollectionException
- Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException
DependencyCollectionException
-
-