Class ClassicConflictResolver
- All Implemented Interfaces:
DependencyGraphTransformer
PathConflictResolver.
For a given set of conflicting nodes, one node will be chosen as the winner. How losing nodes are handled
depends on the configured verbosity level: they may be removed entirely, have their children removed, or
be left in place with conflict information. The exact rules by which a winning node and its effective scope
are determined are controlled by user-supplied implementations of ConflictResolver.VersionSelector, ConflictResolver.ScopeSelector,
ConflictResolver.OptionalitySelector and ConflictResolver.ScopeDeriver.
Performance Characteristics:
- Time Complexity: O(N²) worst-case where N is the number of dependency nodes
- Memory Usage: Modifies the dependency graph in-place
- Scalability: Performance degrades significantly on large multi-module projects
Algorithm Overview:
- Depth-First Traversal: Walks the dependency graph depth-first
- In-Place Modification: Modifies nodes directly during traversal
- Conflict Detection: Identifies conflicts by comparing conflict IDs
- Winner Selection: Uses provided selectors to choose winners
- Loser Removal: Removes or marks losing nodes during traversal
When to Use:
- Exact backward compatibility with Maven 3.x/Resolver 1.x is required
- Debugging performance differences between old and new algorithms
- Small projects where performance is not a concern
- Testing and validation scenarios
Migration Recommendation: New projects should use PathConflictResolver for better
performance. This implementation is retained primarily for compatibility and testing purposes.
Implementation Note: This conflict resolver is identical to the one used in Maven 3/Resolver 1.x. The implementation may produce O(N²) worst-case performance on projects with many small conflict groups (typically one member each), which is common in large multi-module projects.
- Since:
- 2.0.11
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.aether.util.graph.transformer.ConflictResolver
ConflictResolver.OptionalitySelector, ConflictResolver.ScopeDeriver, ConflictResolver.ScopeSelector, ConflictResolver.Verbosity, ConflictResolver.VersionSelector -
Field Summary
Fields inherited from class org.eclipse.aether.util.graph.transformer.ConflictResolver
CLASSIC_CONFLICT_RESOLVER, CONFIG_PROP_CONFLICT_RESOLVER_IMPL, CONFIG_PROP_VERBOSE, DEFAULT_CONFLICT_RESOLVER_IMPL, NODE_DATA_ORIGINAL_OPTIONALITY, NODE_DATA_ORIGINAL_SCOPE, NODE_DATA_WINNER, PATH_CONFLICT_RESOLVER -
Constructor Summary
ConstructorsConstructorDescriptionClassicConflictResolver(ConflictResolver.VersionSelector versionSelector, ConflictResolver.ScopeSelector scopeSelector, ConflictResolver.OptionalitySelector optionalitySelector, ConflictResolver.ScopeDeriver scopeDeriver) Creates a new conflict resolver instance with the specified hooks. -
Method Summary
Modifier and TypeMethodDescriptiontransformGraph(DependencyNode node, DependencyGraphTransformationContext context) Transforms the dependency graph denoted by the specified root node.Methods inherited from class org.eclipse.aether.util.graph.transformer.ConflictResolver
getVerbosity
-
Constructor Details
-
ClassicConflictResolver
public ClassicConflictResolver(ConflictResolver.VersionSelector versionSelector, ConflictResolver.ScopeSelector scopeSelector, ConflictResolver.OptionalitySelector optionalitySelector, ConflictResolver.ScopeDeriver scopeDeriver) Creates a new conflict resolver instance with the specified hooks.- Parameters:
versionSelector- the version selector to use, must not benullscopeSelector- the scope selector to use, must not benulloptionalitySelector- the optionality selector ot use, must not benullscopeDeriver- the scope deriver to use, must not benull
-
-
Method Details
-
transformGraph
public DependencyNode transformGraph(DependencyNode node, DependencyGraphTransformationContext context) throws RepositoryException Description copied from interface:DependencyGraphTransformerTransforms the dependency graph denoted by the specified root node. The transformer may directly change the provided input graph or create a new graph, the former is recommended for performance reasons.- Specified by:
transformGraphin interfaceDependencyGraphTransformer- Overrides:
transformGraphin classConflictResolver- Parameters:
node- The root node of the (possibly cyclic!) graph to transform, must not benull.context- The graph transformation context, must not benull.- Returns:
- The result graph of the transformation, never
null. - Throws:
RepositoryException- If the transformation failed.
-