Class DependencyCollectorDelegate
java.lang.Object
org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate
- All Implemented Interfaces:
DependencyCollector
- Direct Known Subclasses:
BfDependencyCollector
,DfDependencyCollector
Helper class for delegate implementations, they MUST subclass this class.
- Since:
- 1.8.0
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Helper class used during collection. -
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final int
protected static final String
protected static final int
protected ArtifactDescriptorReader
protected final org.slf4j.Logger
protected RemoteRepositoryManager
protected VersionRangeResolver
-
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.Will be dropped once SL gone.protected
DependencyCollectorDelegate
(RemoteRepositoryManager remoteRepositoryManager, ArtifactDescriptorReader artifactDescriptorReader, VersionRangeResolver versionRangeResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected VersionRangeResult
cachedResolveRangeResult
(VersionRangeRequest rangeRequest, DataPool pool, RepositorySystemSession session) final CollectResult
collectDependencies
(RepositorySystemSession session, CollectRequest request) Collects the transitive dependencies of some artifacts and builds a dependency graph.protected RequestTrace
collectStepTrace
(RequestTrace trace, String context, List<DependencyNode> path, Dependency node) Creates childRequestTrace
instance from passed inRequestTrace
and parameters by creatingCollectStepDataImpl
instance out of passed in data.protected static ArtifactDescriptorRequest
createArtifactDescriptorRequest
(String requestContext, RequestTrace requestTrace, List<RemoteRepository> repositories, Dependency d) protected static DefaultDependencyNode
createDependencyNode
(List<Artifact> relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, Collection<Artifact> aliases, List<RemoteRepository> repos, String requestContext) protected static DefaultDependencyNode
createDependencyNode
(List<Artifact> relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, ArtifactDescriptorResult descriptorResult, DependencyNode cycleNode) protected static VersionRangeRequest
createVersionRangeRequest
(String requestContext, RequestTrace requestTrace, List<RemoteRepository> repositories, Dependency dependency) protected abstract void
doCollectDependencies
(RepositorySystemSession session, RequestTrace trace, DataPool pool, DefaultDependencyCollectionContext context, DefaultVersionFilterContext versionContext, CollectRequest request, DependencyNode node, List<RemoteRepository> repositories, List<Dependency> dependencies, List<Dependency> managedDependencies, DependencyCollectorDelegate.Results results) filterVersions
(Dependency dependency, VersionRangeResult rangeResult, VersionFilter verFilter, DefaultVersionFilterContext verContext) protected static String
protected static List<RemoteRepository>
getRemoteRepositories
(ArtifactRepository repository, List<RemoteRepository> repositories) void
initService
(ServiceLocator locator) protected static boolean
isLackingDescriptor
(Artifact artifact) protected List<Dependency>
mergeDeps
(List<Dependency> dominant, List<Dependency> recessive) protected RepositorySystemSession
optimizeSession
(RepositorySystemSession session) setArtifactDescriptorReader
(ArtifactDescriptorReader artifactDescriptorReader) setRemoteRepositoryManager
(RemoteRepositoryManager remoteRepositoryManager) setVersionRangeResolver
(VersionRangeResolver versionRangeResolver)
-
Field Details
-
CONFIG_PROP_MAX_EXCEPTIONS
- See Also:
-
CONFIG_PROP_MAX_EXCEPTIONS_DEFAULT
- See Also:
-
CONFIG_PROP_MAX_CYCLES
- See Also:
-
CONFIG_PROP_MAX_CYCLES_DEFAULT
- See Also:
-
logger
-
remoteRepositoryManager
-
descriptorReader
-
versionRangeResolver
-
-
Constructor Details
-
DependencyCollectorDelegate
Deprecated.Will be dropped once SL gone.Default ctor for SL. -
DependencyCollectorDelegate
protected DependencyCollectorDelegate(RemoteRepositoryManager remoteRepositoryManager, ArtifactDescriptorReader artifactDescriptorReader, VersionRangeResolver versionRangeResolver)
-
-
Method Details
-
initService
-
setRemoteRepositoryManager
public DependencyCollector setRemoteRepositoryManager(RemoteRepositoryManager remoteRepositoryManager) -
setArtifactDescriptorReader
public DependencyCollector setArtifactDescriptorReader(ArtifactDescriptorReader artifactDescriptorReader) -
setVersionRangeResolver
-
collectDependencies
public final CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request) 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:
session
- The repository session, must not benull
.request
- The collection request, must not benull
.- Returns:
- The collection result, never
null
. - Throws:
DependencyCollectionException
- If the dependency tree could not be built.- See Also:
-
RepositorySystemSession.getDependencyTraverser()
RepositorySystemSession.getDependencyManager()
RepositorySystemSession.getDependencySelector()
RepositorySystemSession.getVersionFilter()
RepositorySystemSession.getDependencyGraphTransformer()
RepositorySystem.collectDependencies(RepositorySystemSession, CollectRequest)
-
collectStepTrace
protected RequestTrace collectStepTrace(RequestTrace trace, String context, List<DependencyNode> path, Dependency node) Creates childRequestTrace
instance from passed inRequestTrace
and parameters by creatingCollectStepDataImpl
instance out of passed in data. Caller must ensure that passed in parameters are NOT affected by threading (or that there is no multi threading involved). In other words, the passed in values should be immutable.- Parameters:
trace
- The current trace instance.context
- The context fromCollectRequest.getRequestContext()
, nevernull
.path
- List representing the path of dependency nodes, nevernull
. Caller must ensure, that this list does not change during the lifetime of the requestedRequestTrace
instance. If it may change, simplest is to pass here a copy of used list.node
- Currently collected node, that collector came by following the passed in path.- Returns:
- A child request trance instance, never
null
.
-
doCollectDependencies
protected abstract void doCollectDependencies(RepositorySystemSession session, RequestTrace trace, DataPool pool, DefaultDependencyCollectionContext context, DefaultVersionFilterContext versionContext, CollectRequest request, DependencyNode node, List<RemoteRepository> repositories, List<Dependency> dependencies, List<Dependency> managedDependencies, DependencyCollectorDelegate.Results results) -
optimizeSession
-
mergeDeps
-
getId
-
createDependencyNode
protected static DefaultDependencyNode createDependencyNode(List<Artifact> relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, Collection<Artifact> aliases, List<RemoteRepository> repos, String requestContext) -
createDependencyNode
protected static DefaultDependencyNode createDependencyNode(List<Artifact> relocations, PremanagedDependency preManaged, VersionRangeResult rangeResult, Version version, Dependency d, ArtifactDescriptorResult descriptorResult, DependencyNode cycleNode) -
createArtifactDescriptorRequest
protected static ArtifactDescriptorRequest createArtifactDescriptorRequest(String requestContext, RequestTrace requestTrace, List<RemoteRepository> repositories, Dependency d) -
createVersionRangeRequest
protected static VersionRangeRequest createVersionRangeRequest(String requestContext, RequestTrace requestTrace, List<RemoteRepository> repositories, Dependency dependency) -
cachedResolveRangeResult
protected VersionRangeResult cachedResolveRangeResult(VersionRangeRequest rangeRequest, DataPool pool, RepositorySystemSession session) throws VersionRangeResolutionException - Throws:
VersionRangeResolutionException
-
isLackingDescriptor
-
getRemoteRepositories
protected static List<RemoteRepository> getRemoteRepositories(ArtifactRepository repository, List<RemoteRepository> repositories) -
filterVersions
protected static List<? extends Version> filterVersions(Dependency dependency, VersionRangeResult rangeResult, VersionFilter verFilter, DefaultVersionFilterContext verContext) throws VersionRangeResolutionException - Throws:
VersionRangeResolutionException
-