Search in sources :

Example 1 with RestartResolveProcess

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);
    }
}
Also used : RestartResolveProcess(org.apache.ivy.core.resolve.RestartResolveProcess) IvyNodeBlacklist(org.apache.ivy.core.resolve.IvyNodeBlacklist) EvictionData(org.apache.ivy.core.resolve.IvyNodeEviction.EvictionData) IvyNode(org.apache.ivy.core.resolve.IvyNode) Stack(java.util.Stack)

Aggregations

Stack (java.util.Stack)1 IvyNode (org.apache.ivy.core.resolve.IvyNode)1 IvyNodeBlacklist (org.apache.ivy.core.resolve.IvyNodeBlacklist)1 EvictionData (org.apache.ivy.core.resolve.IvyNodeEviction.EvictionData)1 RestartResolveProcess (org.apache.ivy.core.resolve.RestartResolveProcess)1