Class AbstractDependencyManager
- All Implemented Interfaces:
org.eclipse.aether.collection.DependencyManager
- Direct Known Subclasses:
ClassicDependencyManager
,DefaultDependencyManager
,TransitiveDependencyManager
This implementation is Maven specific, as it works hand-in-hand along with Maven ModelBuilder. While model builder handles dependency management in the context of single POM (inheritance, imports, etc.), this implementation carries in-lineage modifications based on previously recorded dependency management rules sourced from ascendants while building the dependency graph. Root sourced management rules are special, in a way they are always applied, while en-route collected ones are carefully applied to proper descendants only, to not override work done by model builder already.
Details: Model builder handles version, scope from own dependency management (think "effective POM"). On the other hand it does not handle optional for example. System paths are aligned across whole graph, making sure there is same system path used by same dependency. Finally, exclusions (exclusions are additional information not effective or applied in same POM) are always applied. This implementation makes sure, that version and scope are not applied onto same node that actually provided the rules, to no override work that ModelBuilder did. It achieves this goal by tracking "depth" for each collected rule and ignoring rules coming from same depth as processed dependency node is.
- Since:
- 2.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
protected final int
protected final int
protected final Map
<Object, Collection<AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>>> protected final Map
<Object, AbstractDependencyManager.Holder<String>> protected final Map
<Object, AbstractDependencyManager.Holder<Boolean>> protected final Map
<Object, AbstractDependencyManager.Holder<String>> protected final Map
<Object, AbstractDependencyManager.Holder<String>> protected final org.eclipse.aether.scope.SystemDependencyScope
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractDependencyManager
(int depth, int deriveUntil, int applyFrom, Map<Object, AbstractDependencyManager.Holder<String>> managedVersions, Map<Object, AbstractDependencyManager.Holder<String>> managedScopes, Map<Object, AbstractDependencyManager.Holder<Boolean>> managedOptionals, Map<Object, AbstractDependencyManager.Holder<String>> managedLocalPaths, Map<Object, Collection<AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>>> managedExclusions, org.eclipse.aether.scope.SystemDependencyScope systemDependencyScope) protected
AbstractDependencyManager
(int deriveUntil, int applyFrom, org.eclipse.aether.scope.ScopeManager scopeManager) -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.aether.collection.DependencyManager
deriveChildManager
(org.eclipse.aether.collection.DependencyCollectionContext context) boolean
int
hashCode()
protected boolean
isApplicable
(AbstractDependencyManager.Holder<?> holder) Returnstrue
if rule in holder is applicable at current depth.protected boolean
Returnstrue
if current dependency should be managed according to so far collected/derived rules.protected boolean
Returnstrue
if current context should be factored in (collected/derived).org.eclipse.aether.collection.DependencyManagement
manageDependency
(org.eclipse.aether.graph.Dependency dependency) protected abstract org.eclipse.aether.collection.DependencyManager
newInstance
(Map<Object, AbstractDependencyManager.Holder<String>> managedVersions, Map<Object, AbstractDependencyManager.Holder<String>> managedScopes, Map<Object, AbstractDependencyManager.Holder<Boolean>> managedOptionals, Map<Object, AbstractDependencyManager.Holder<String>> managedLocalPaths, Map<Object, Collection<AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>>> managedExclusions)
-
Field Details
-
depth
-
deriveUntil
-
applyFrom
-
managedVersions
-
managedScopes
-
managedOptionals
-
managedLocalPaths
-
managedExclusions
protected final Map<Object,Collection<AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>>> managedExclusions -
systemDependencyScope
-
-
Constructor Details
-
AbstractDependencyManager
protected AbstractDependencyManager(int deriveUntil, int applyFrom, org.eclipse.aether.scope.ScopeManager scopeManager) -
AbstractDependencyManager
protected AbstractDependencyManager(int depth, int deriveUntil, int applyFrom, Map<Object, AbstractDependencyManager.Holder<String>> managedVersions, Map<Object, AbstractDependencyManager.Holder<String>> managedScopes, Map<Object, AbstractDependencyManager.Holder<Boolean>> managedOptionals, Map<Object, AbstractDependencyManager.Holder<String>> managedLocalPaths, Map<Object, Collection<AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>>> managedExclusions, org.eclipse.aether.scope.SystemDependencyScope systemDependencyScope)
-
-
Method Details
-
newInstance
protected abstract org.eclipse.aether.collection.DependencyManager newInstance(Map<Object, AbstractDependencyManager.Holder<String>> managedVersions, Map<Object, AbstractDependencyManager.Holder<String>> managedScopes, Map<Object, AbstractDependencyManager.Holder<Boolean>> managedOptionals, Map<Object, AbstractDependencyManager.Holder<String>> managedLocalPaths, Map<Object, Collection<AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>>> managedExclusions) -
deriveChildManager
public org.eclipse.aether.collection.DependencyManager deriveChildManager(org.eclipse.aether.collection.DependencyCollectionContext context) - Specified by:
deriveChildManager
in interfaceorg.eclipse.aether.collection.DependencyManager
-
manageDependency
public org.eclipse.aether.collection.DependencyManagement manageDependency(org.eclipse.aether.graph.Dependency dependency) - Specified by:
manageDependency
in interfaceorg.eclipse.aether.collection.DependencyManager
-
isDerived
Returnstrue
if current context should be factored in (collected/derived). -
isApplied
Returnstrue
if current dependency should be managed according to so far collected/derived rules. -
isApplicable
Returnstrue
if rule in holder is applicable at current depth. -
equals
-
hashCode
-