use of org.apache.ivy.core.resolve.RestartResolveProcess in project ant-ivy by apache.
the class LatestCompatibleConflictManager method blackListIncompatibleCallerAndRestartResolveIfPossible.
private void blackListIncompatibleCallerAndRestartResolveIfPossible(IvySettings settings, IvyNode parent, IvyNode selected, IvyNode evicted) {
Stack<IvyNode> callerStack = new Stack<>();
callerStack.push(evicted);
Collection<IvyNodeBlacklist> toBlacklist = blackListIncompatibleCaller(settings.getVersionMatcher(), parent, selected, evicted, callerStack);
if (toBlacklist != null) {
final StringBuilder blacklisted = new StringBuilder();
for (IvyNodeBlacklist blacklist : toBlacklist) {
if (blacklisted.length() > 0) {
blacklisted.append(" ");
}
IvyNode blacklistedNode = blacklist.getBlacklistedNode();
blacklistedNode.blacklist(blacklist);
blacklisted.append(blacklistedNode);
}
String rootModuleConf = parent.getData().getReport().getConfiguration();
evicted.markEvicted(new EvictionData(rootModuleConf, parent, this, Collections.singleton(selected), "with blacklisting of " + blacklisted));
if (settings.debugConflictResolution()) {
Message.debug("evicting " + evicted + " by " + evicted.getEvictedData(rootModuleConf));
}
throw new RestartResolveProcess("trying to handle incompatibilities between " + selected + " and " + evicted);
}
}
Aggregations