Search in sources :

Example 1 with CircularDependencyStrategy

use of org.apache.ivy.plugins.circular.CircularDependencyStrategy in project ant-ivy by apache.

the class XmlSettingsParser method endDocument.

@Override
public void endDocument() throws SAXException {
    if (defaultResolver != null) {
        ivy.setDefaultResolver(ivy.substitute(defaultResolver));
    }
    if (defaultCM != null) {
        ConflictManager conflictManager = ivy.getConflictManager(ivy.substitute(defaultCM));
        if (conflictManager == null) {
            throw new IllegalArgumentException("unknown conflict manager " + ivy.substitute(defaultCM));
        }
        ivy.setDefaultConflictManager(conflictManager);
    }
    if (defaultLatest != null) {
        LatestStrategy latestStrategy = ivy.getLatestStrategy(ivy.substitute(defaultLatest));
        if (latestStrategy == null) {
            throw new IllegalArgumentException("unknown latest strategy " + ivy.substitute(defaultLatest));
        }
        ivy.setDefaultLatestStrategy(latestStrategy);
    }
    if (defaultCacheManager != null) {
        RepositoryCacheManager cache = ivy.getRepositoryCacheManager(ivy.substitute(defaultCacheManager));
        if (cache == null) {
            throw new IllegalArgumentException("unknown cache manager " + ivy.substitute(defaultCacheManager));
        }
        ivy.setDefaultRepositoryCacheManager(cache);
    }
    if (defaultCircular != null) {
        CircularDependencyStrategy strategy = ivy.getCircularDependencyStrategy(ivy.substitute(defaultCircular));
        if (strategy == null) {
            throw new IllegalArgumentException("unknown circular dependency strategy " + ivy.substitute(defaultCircular));
        }
        ivy.setCircularDependencyStrategy(strategy);
    }
    if (defaultLock != null) {
        LockStrategy strategy = ivy.getLockStrategy(ivy.substitute(defaultLock));
        if (strategy == null) {
            throw new IllegalArgumentException("unknown lock strategy " + ivy.substitute(defaultLock));
        }
        ivy.setDefaultLockStrategy(strategy);
    }
}
Also used : CircularDependencyStrategy(org.apache.ivy.plugins.circular.CircularDependencyStrategy) RepositoryCacheManager(org.apache.ivy.core.cache.RepositoryCacheManager) LatestStrategy(org.apache.ivy.plugins.latest.LatestStrategy) ConflictManager(org.apache.ivy.plugins.conflict.ConflictManager) LockStrategy(org.apache.ivy.plugins.lock.LockStrategy)

Aggregations

RepositoryCacheManager (org.apache.ivy.core.cache.RepositoryCacheManager)1 CircularDependencyStrategy (org.apache.ivy.plugins.circular.CircularDependencyStrategy)1 ConflictManager (org.apache.ivy.plugins.conflict.ConflictManager)1 LatestStrategy (org.apache.ivy.plugins.latest.LatestStrategy)1 LockStrategy (org.apache.ivy.plugins.lock.LockStrategy)1