use of org.eclipse.aether.util.graph.transformer.ConflictIdSorter in project fabric8 by jboss-fuse.
the class ReplaceConflictingVersionResolver method transformGraph.
public DependencyNode transformGraph(DependencyNode node, DependencyGraphTransformationContext context) throws RepositoryException {
List<?> sortedConflictIds = (List<?>) context.get(TransformationContextKeys.SORTED_CONFLICT_IDS);
if (sortedConflictIds == null) {
ConflictIdSorter sorter = new ConflictIdSorter();
sorter.transformGraph(node, context);
sortedConflictIds = (List<?>) context.get(TransformationContextKeys.SORTED_CONFLICT_IDS);
}
Map<?, ?> conflictIds = (Map<?, ?>) context.get(TransformationContextKeys.CONFLICT_IDS);
if (conflictIds == null) {
throw new RepositoryException("conflict groups have not been identified");
}
Map<DependencyNode, Integer> depths = new TreeMap<DependencyNode, Integer>(DependencyNodeComparator.INSTANCE);
for (Object key : sortedConflictIds) {
ConflictGroup group = new ConflictGroup(key);
depths.clear();
selectVersion(node, null, 0, depths, group, conflictIds);
updateNonSelectedVersions(group, conflictIds);
}
return node;
}
Aggregations