Class ConflictMarker
- java.lang.Object
-
- org.eclipse.aether.util.graph.transformer.ConflictMarker
-
- All Implemented Interfaces:
DependencyGraphTransformer
public final class ConflictMarker extends java.lang.Object implements DependencyGraphTransformer
A dependency graph transformer that identifies conflicting dependencies. When this transformer has executed, the transformation context holds aMap<DependencyNode, Object>
where dependency nodes that belong to the same conflict group will have an equal conflict identifier. This map is stored using the keyTransformationContextKeys.CONFLICT_IDS
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ConflictMarker.ConflictGroup
(package private) static class
ConflictMarker.Key
-
Constructor Summary
Constructors Constructor Description ConflictMarker()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
analyze(DependencyNode node, java.util.Map<DependencyNode,java.lang.Object> nodes, java.util.Map<java.lang.Object,ConflictMarker.ConflictGroup> groups, int[] counter)
private java.util.Set<java.lang.Object>
getKeys(DependencyNode node)
private java.util.Map<DependencyNode,java.lang.Object>
mark(java.util.Collection<DependencyNode> nodes, java.util.Map<java.lang.Object,ConflictMarker.ConflictGroup> groups)
private java.util.Set<java.lang.Object>
merge(java.util.Set<java.lang.Object> keys1, java.util.Set<java.lang.Object> keys2)
private static java.lang.Object
toKey(Artifact artifact)
DependencyNode
transformGraph(DependencyNode node, DependencyGraphTransformationContext context)
After the execution of this method, every DependencyNode with an attached dependency is member of one conflict group.
-
-
-
Method Detail
-
transformGraph
public DependencyNode transformGraph(DependencyNode node, DependencyGraphTransformationContext context) throws RepositoryException
After the execution of this method, every DependencyNode with an attached dependency is member of one conflict group.- Specified by:
transformGraph
in interfaceDependencyGraphTransformer
- 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.- See Also:
DependencyGraphTransformer.transformGraph(DependencyNode, DependencyGraphTransformationContext)
-
analyze
private void analyze(DependencyNode node, java.util.Map<DependencyNode,java.lang.Object> nodes, java.util.Map<java.lang.Object,ConflictMarker.ConflictGroup> groups, int[] counter)
-
merge
private java.util.Set<java.lang.Object> merge(java.util.Set<java.lang.Object> keys1, java.util.Set<java.lang.Object> keys2)
-
getKeys
private java.util.Set<java.lang.Object> getKeys(DependencyNode node)
-
mark
private java.util.Map<DependencyNode,java.lang.Object> mark(java.util.Collection<DependencyNode> nodes, java.util.Map<java.lang.Object,ConflictMarker.ConflictGroup> groups)
-
toKey
private static java.lang.Object toKey(Artifact artifact)
-
-