Class ClassicDependencyManager
- All Implemented Interfaces:
org.eclipse.aether.collection.DependencyManager
Overview
This manager was used throughout all Maven 3.x versions for backward compatibility reasons. It provides the exact same dependency management behavior as Maven 2.x, which differs significantly from modern dependency management approaches.
Key Characteristics
- Exclusion Handling: Ignores exclusions introduced by direct dependencies
- Management Scope: Only obeys root management, ignoring intermediate management
- Depth Behavior:
deriveUntil=2
,applyFrom=2
with special "hop" atdepth=1
- Level 1 Skip: Ignores context from depth=1 for Maven 2.x compatibility
When to Use
Use this manager when you need exact Maven 2.x compatibility behavior or when working with legacy projects that depend on Maven 2.x dependency resolution semantics.
Comparison with Other Managers
Unlike TransitiveDependencyManager
and DefaultDependencyManager
, this manager
deliberately ignores certain dependency management rules to maintain backward compatibility.
See MavenITmng4720DependencyManagementExclusionMergeTest
for behavioral differences.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.aether.util.graph.manager.AbstractDependencyManager
AbstractDependencyManager.Holder<T>, AbstractDependencyManager.Key
-
Field Summary
Fields inherited from class org.eclipse.aether.util.graph.manager.AbstractDependencyManager
applyFrom, depth, deriveUntil, managedExclusions, managedLocalPaths, managedOptionals, managedScopes, managedVersions, path, systemDependencyScope
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ClassicDependencyManager
(org.eclipse.aether.scope.ScopeManager scopeManager) Creates a new dependency manager without any management information. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.aether.collection.DependencyManager
deriveChildManager
(org.eclipse.aether.collection.DependencyCollectionContext context) Derives a child manager with Maven 2.x compatibility behavior.protected org.eclipse.aether.collection.DependencyManager
newInstance
(MMap<AbstractDependencyManager.Key, String> managedVersions, MMap<AbstractDependencyManager.Key, String> managedScopes, MMap<AbstractDependencyManager.Key, Boolean> managedOptionals, MMap<AbstractDependencyManager.Key, String> managedLocalPaths, MMap<AbstractDependencyManager.Key, AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>> managedExclusions) Methods inherited from class org.eclipse.aether.util.graph.manager.AbstractDependencyManager
equals, hashCode, isApplied, isDerived, isInheritedDerived, manageDependency
-
Constructor Details
-
ClassicDependencyManager
Deprecated.UseClassicDependencyManager(ScopeManager)
instead to provide application-specific scope management. This constructor uses legacy system dependency scope handling which may not be appropriate for all use cases.Creates a new dependency manager without any management information. -
ClassicDependencyManager
Creates a new dependency manager without any management information.This constructor initializes the manager with Maven 2.x compatible behavior:
- deriveUntil = 2 (collect rules only from root level)
- applyFrom = 2 (apply rules starting from depth 2)
- Special depth=1 handling for backward compatibility
- Parameters:
scopeManager
- application-specific scope manager for handling system dependencies, may be null to use legacy system dependency scope handling- Since:
- 2.0.12
-
-
Method Details
-
deriveChildManager
public org.eclipse.aether.collection.DependencyManager deriveChildManager(org.eclipse.aether.collection.DependencyCollectionContext context) Derives a child manager with Maven 2.x compatibility behavior.Critical Maven 2.x Compatibility: This method implements a special "hop" at depth=1 that skips dependency management collection at that level. This behavior is essential for Maven 2.x compatibility and is verified by integration tests.
Why the depth=1 skip is necessary: Maven 2.x did not collect dependency management from first-level dependencies, only from the root. Removing this skip would break backward compatibility with Maven 2.x projects.
- Specified by:
deriveChildManager
in interfaceorg.eclipse.aether.collection.DependencyManager
- Overrides:
deriveChildManager
in classAbstractDependencyManager
- Parameters:
context
- the dependency collection context- Returns:
- a new child manager or the current instance with passed-through management
- See Also:
-
newInstance
protected org.eclipse.aether.collection.DependencyManager newInstance(MMap<AbstractDependencyManager.Key, String> managedVersions, MMap<AbstractDependencyManager.Key, String> managedScopes, MMap<AbstractDependencyManager.Key, Boolean> managedOptionals, MMap<AbstractDependencyManager.Key, String> managedLocalPaths, MMap<AbstractDependencyManager.Key, AbstractDependencyManager.Holder<Collection<org.eclipse.aether.graph.Exclusion>>> managedExclusions) - Specified by:
newInstance
in classAbstractDependencyManager
-
ClassicDependencyManager(ScopeManager)
instead to provide application-specific scope management.