Class DefaultGraphConflictResolver
- java.lang.Object
-
- org.apache.maven.repository.metadata.DefaultGraphConflictResolver
-
- All Implemented Interfaces:
GraphConflictResolver
@Component(role=GraphConflictResolver.class) public class DefaultGraphConflictResolver extends java.lang.Object implements GraphConflictResolver
Default conflict resolver.Implements closer newer first policy by default, but could be configured via plexus
-
-
Field Summary
Fields Modifier and Type Field Description protected GraphConflictResolutionPolicypolicyartifact, closer to the entry point, is selected-
Fields inherited from interface org.apache.maven.repository.metadata.GraphConflictResolver
ROLE
-
-
Constructor Summary
Constructors Constructor Description DefaultGraphConflictResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private MetadataGraphEdgecleanEdges(MetadataGraphVertex v, java.util.List<MetadataGraphEdge> edges, ArtifactScopeEnum scope)private MetadataGraphfindLinkedSubgraph(MetadataGraph g)MetadataGraphresolveConflicts(MetadataGraph graph, ArtifactScopeEnum scope)Cleanses the supplied graph by leaving only one directed versioned edge\ between any two nodes, if multiple exists.private voidvisit(MetadataGraphVertex from, java.util.List<MetadataGraphVertex> visited, MetadataGraph graph)
-
-
-
Field Detail
-
policy
@Requirement(role=GraphConflictResolutionPolicy.class) protected GraphConflictResolutionPolicy policy
artifact, closer to the entry point, is selected
-
-
Method Detail
-
resolveConflicts
public MetadataGraph resolveConflicts(MetadataGraph graph, ArtifactScopeEnum scope) throws GraphConflictResolutionException
Description copied from interface:GraphConflictResolverCleanses the supplied graph by leaving only one directed versioned edge\ between any two nodes, if multiple exists. Uses scope relationships, defined inArtifactScopeEnum- Specified by:
resolveConflictsin interfaceGraphConflictResolver- Parameters:
graph- the "dirty" graph to be simplified via conflict resolutionscope- scope for which the graph should be resolved- Returns:
- resulting "clean" graph for the specified scope
- Throws:
GraphConflictResolutionException
-
findLinkedSubgraph
private MetadataGraph findLinkedSubgraph(MetadataGraph g)
-
visit
private void visit(MetadataGraphVertex from, java.util.List<MetadataGraphVertex> visited, MetadataGraph graph)
-
cleanEdges
private MetadataGraphEdge cleanEdges(MetadataGraphVertex v, java.util.List<MetadataGraphEdge> edges, ArtifactScopeEnum scope)
-
-