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 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollectDependencies
(org.apache.maven.project.ProjectBuildingRequest buildingRequest, org.apache.maven.model.Dependency root) Collects the transitive dependencies of some artifacts and builds a dependency graph.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.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
private void
validateBuildingRequest
(org.apache.maven.project.ProjectBuildingRequest buildingRequest) private void
validateBuildingRequestAndRoot
(org.apache.maven.project.ProjectBuildingRequest buildingRequest, 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
(Object root)
-
Field Details
-
container
private org.codehaus.plexus.PlexusContainer container
-
-
Constructor Details
-
DefaultDependencyCollector
DefaultDependencyCollector()
-
-
Method Details
-
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, 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, 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, Object root) -
validateBuildingRequest
private void validateBuildingRequest(org.apache.maven.project.ProjectBuildingRequest buildingRequest) -
validateRoot
-
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
-