Java Code Examples for org.apache.ivy.core.resolve.ResolvedModuleRevision#isForce()

The following examples show how to use org.apache.ivy.core.resolve.ResolvedModuleRevision#isForce() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicResolver.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
protected boolean shouldReturnResolvedModule(DependencyDescriptor dd, ResolvedModuleRevision mr) {
    // a resolved module revision has already been found by a prior dependency resolver
    // let's see if it should be returned and bypass this resolver

    ModuleRevisionId mrid = dd.getDependencyRevisionId();
    boolean isDynamic = getSettings().getVersionMatcher().isDynamic(mrid);
    boolean shouldReturn = mr.isForce();
    shouldReturn |= !isDynamic && !mr.getDescriptor().isDefault();
    shouldReturn &= !isForce();

    return shouldReturn;
}
 
Example 2
Source File: BasicResolver.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
private ResolvedModuleRevision checkForcedResolvedModuleRevision(ResolvedModuleRevision rmr) {
    if (rmr == null) {
        return null;
    }
    if (!isForce() || rmr.isForce()) {
        return rmr;
    }
    return new ResolvedModuleRevision(rmr.getResolver(), rmr.getArtifactResolver(),
            rmr.getDescriptor(), rmr.getReport(), true);
}
 
Example 3
Source File: ChainResolver.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
private ResolvedModuleRevision resolvedRevision(ResolvedModuleRevision mr) {
    if (isDual() && mr != null) {
        return new ResolvedModuleRevision(mr.getResolver(), this, mr.getDescriptor(),
                mr.getReport(), mr.isForce());
    } else {
        return mr;
    }
}
 
Example 4
Source File: NameSpaceHelper.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
public static ResolvedModuleRevision toSystem(ResolvedModuleRevision rmr, Namespace ns) {
    if (ns.getToSystemTransformer().isIdentity()) {
        return rmr;
    }
    ModuleDescriptor md = toSystem(rmr.getDescriptor(), ns);
    if (md.equals(rmr.getDescriptor())) {
        return rmr;
    }
    return new ResolvedModuleRevision(rmr.getResolver(), rmr.getArtifactResolver(), md,
            transform(rmr.getReport(), ns.getToSystemTransformer()), rmr.isForce());
}
 
Example 5
Source File: MockResolver.java    From ant-ivy with Apache License 2.0 5 votes vote down vote up
private boolean shouldReturnResolvedModule(DependencyDescriptor dd, ResolvedModuleRevision mr) {
    // a resolved module revision has already been found by a prior dependency resolver
    // let's see if it should be returned and bypass this resolver

    ModuleRevisionId mrid = dd.getDependencyRevisionId();
    boolean isDynamic = getSettings().getVersionMatcher().isDynamic(mrid);
    boolean shouldReturn = mr.isForce();
    shouldReturn |= !isDynamic && !mr.getDescriptor().isDefault();

    return shouldReturn;
}