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 final Map
<String, ArtifactDecoratorFactory> static final String
Only up to the given amount cyclic dependencies are emitted.static final String
Only exceptions up to the number given in this configuration property are emitted.static final int
static final int
protected final ArtifactDescriptorReader
protected final org.slf4j.Logger
protected final RemoteRepositoryManager
protected final VersionRangeResolver
-
Constructor Summary
ModifierConstructorDescriptionprotected
DependencyCollectorDelegate
(RemoteRepositoryManager remoteRepositoryManager, ArtifactDescriptorReader artifactDescriptorReader, VersionRangeResolver versionRangeResolver, Map<String, ArtifactDecoratorFactory> artifactDecoratorFactories) -
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) protected static boolean
isLackingDescriptor
(RepositorySystemSession session, Artifact artifact) protected List
<Dependency> mergeDeps
(List<Dependency> dominant, List<Dependency> recessive) protected ArtifactDescriptorResult
resolveCachedArtifactDescriptor
(DataPool pool, ArtifactDescriptorRequest descriptorRequest, RepositorySystemSession session, Dependency d, DependencyCollectorDelegate.Results results, List<DependencyNode> nodes) protected RepositorySystemSession
setUpSession
(RepositorySystemSession session, CollectRequest collectRequest, InternalScopeManager scopeManager)
-
Field Details
-
CONFIG_PROP_MAX_EXCEPTIONS
Only exceptions up to the number given in this configuration property are emitted. Exceptions which exceed that number are swallowed.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
Integer
- Default value:
DEFAULT_MAX_EXCEPTIONS
-
DEFAULT_MAX_EXCEPTIONS
- See Also:
-
CONFIG_PROP_MAX_CYCLES
Only up to the given amount cyclic dependencies are emitted.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
Integer
- Default value:
DEFAULT_MAX_CYCLES
-
DEFAULT_MAX_CYCLES
- See Also:
-
logger
-
remoteRepositoryManager
-
descriptorReader
-
versionRangeResolver
-
artifactDecoratorFactories
-
-
Constructor Details
-
DependencyCollectorDelegate
protected DependencyCollectorDelegate(RemoteRepositoryManager remoteRepositoryManager, ArtifactDescriptorReader artifactDescriptorReader, VersionRangeResolver versionRangeResolver, Map<String, ArtifactDecoratorFactory> artifactDecoratorFactories)
-
-
Method Details
-
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:
-
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) throws DependencyCollectionException - Throws:
DependencyCollectionException
-
setUpSession
protected RepositorySystemSession setUpSession(RepositorySystemSession session, CollectRequest collectRequest, InternalScopeManager scopeManager) -
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
-
resolveCachedArtifactDescriptor
protected ArtifactDescriptorResult resolveCachedArtifactDescriptor(DataPool pool, ArtifactDescriptorRequest descriptorRequest, RepositorySystemSession session, Dependency d, DependencyCollectorDelegate.Results results, List<DependencyNode> nodes)
-