Class ClassicDependencyManager
- java.lang.Object
-
- org.eclipse.aether.util.graph.manager.AbstractDependencyManager
-
- org.eclipse.aether.util.graph.manager.ClassicDependencyManager
-
- All Implemented Interfaces:
org.eclipse.aether.collection.DependencyManager
public final class ClassicDependencyManager extends AbstractDependencyManager
A dependency manager that mimics the way Maven 2.x works for backward compatibility.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=2with 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
TransitiveDependencyManagerandDefaultDependencyManager, this manager deliberately ignores certain dependency management rules to maintain backward compatibility. SeeMavenITmng4720DependencyManagementExclusionMergeTestfor behavioral differences.
-
-
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
Constructors Constructor Description ClassicDependencyManager()Creates a new dependency manager without any management information.ClassicDependencyManager(org.eclipse.aether.scope.ScopeManager scopeManager)Creates a new dependency manager without any management information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.aether.collection.DependencyManagerderiveChildManager(org.eclipse.aether.collection.DependencyCollectionContext context)Derives a child manager with Maven 2.x compatibility behavior.protected org.eclipse.aether.collection.DependencyManagernewInstance(MMap<AbstractDependencyManager.Key,java.lang.String> managedVersions, MMap<AbstractDependencyManager.Key,java.lang.String> managedScopes, MMap<AbstractDependencyManager.Key,java.lang.Boolean> managedOptionals, MMap<AbstractDependencyManager.Key,java.lang.String> managedLocalPaths, MMap<AbstractDependencyManager.Key,AbstractDependencyManager.Holder<java.util.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 Detail
-
ClassicDependencyManager
public ClassicDependencyManager()
Creates a new dependency manager without any management information.
-
ClassicDependencyManager
public ClassicDependencyManager(org.eclipse.aether.scope.ScopeManager scopeManager)
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 Detail
-
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:
deriveChildManagerin interfaceorg.eclipse.aether.collection.DependencyManager- Overrides:
deriveChildManagerin classAbstractDependencyManager- Parameters:
context- the dependency collection context- Returns:
- a new child manager or the current instance with passed-through management
- See Also:
- MNG-4720 Integration Test
-
newInstance
protected org.eclipse.aether.collection.DependencyManager newInstance(MMap<AbstractDependencyManager.Key,java.lang.String> managedVersions, MMap<AbstractDependencyManager.Key,java.lang.String> managedScopes, MMap<AbstractDependencyManager.Key,java.lang.Boolean> managedOptionals, MMap<AbstractDependencyManager.Key,java.lang.String> managedLocalPaths, MMap<AbstractDependencyManager.Key,AbstractDependencyManager.Holder<java.util.Collection<org.eclipse.aether.graph.Exclusion>>> managedExclusions)
- Specified by:
newInstancein classAbstractDependencyManager
-
-