当前位置: 首页>>代码示例>>Java>>正文


Java ModuleDescriptor.getResolvedModuleRevisionId方法代码示例

本文整理汇总了Java中org.apache.ivy.core.module.descriptor.ModuleDescriptor.getResolvedModuleRevisionId方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleDescriptor.getResolvedModuleRevisionId方法的具体用法?Java ModuleDescriptor.getResolvedModuleRevisionId怎么用?Java ModuleDescriptor.getResolvedModuleRevisionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ivy.core.module.descriptor.ModuleDescriptor的用法示例。


在下文中一共展示了ModuleDescriptor.getResolvedModuleRevisionId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveResolvedModuleDescriptor

import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
public void saveResolvedModuleDescriptor(ModuleDescriptor md) throws ParseException,
        IOException {
    ModuleRevisionId mrevId = md.getResolvedModuleRevisionId();
    File ivyFileInCache = getResolvedIvyFileInCache(mrevId);
    md.toIvyFile(ivyFileInCache);

    Properties paths = new Properties();
    saveLocalParents(mrevId, md, ivyFileInCache, paths);

    if (!paths.isEmpty()) {
        File parentsFile = getResolvedIvyPropertiesInCache(ModuleRevisionId.newInstance(mrevId,
            mrevId.getRevision() + "-parents"));
        FileOutputStream out = new FileOutputStream(parentsFile);
        paths.store(out, null);
        out.close();
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:18,代码来源:DefaultResolutionCacheManager.java

示例2: saveResolvers

import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
/**
 * Saves the information of which resolver was used to resolve a md, so that this info can be
 * retrieve later (even after a jvm restart) by getSavedArtResolverName(ModuleDescriptor md)
 *
 * @param md
 *            the module descriptor resolved
 * @param metadataResolverName
 *            metadata resolver name
 * @param artifactResolverName
 *            artifact resolver name
 */
public void saveResolvers(ModuleDescriptor md, String metadataResolverName,
        String artifactResolverName) {
    ModuleRevisionId mrid = md.getResolvedModuleRevisionId();
    if (!lockMetadataArtifact(mrid)) {
        Message.error("impossible to acquire lock for " + mrid);
        return;
    }
    try {
        PropertiesFile cdf = getCachedDataFile(md);
        cdf.setProperty("resolver", metadataResolverName);
        cdf.setProperty("artifact.resolver", artifactResolverName);
        cdf.save();
    } finally {
        unlockMetadataArtifact(mrid);
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:28,代码来源:DefaultRepositoryCacheManager.java

示例3: resolveAndCheckRevision

import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private void resolveAndCheckRevision(ModuleDescriptor systemMd,
        ModuleRevisionId dependencyConstraint, ResolvedResource ivyRef, boolean isDynamic) {
    // we get the resolved module revision id from the descriptor: it may contain extra
    // attributes that were not included in the dependency constraint
    ModuleRevisionId resolvedMrid = systemMd.getResolvedModuleRevisionId();
    if (resolvedMrid.getRevision() == null || resolvedMrid.getRevision().length() == 0
            || resolvedMrid.getRevision().startsWith("[email protected]")) {
        if (!isDynamic) {
            resolvedMrid = ModuleRevisionId.newInstance(resolvedMrid,
                dependencyConstraint.getRevision());
        } else if (ivyRef == null) {
            resolvedMrid = systemMd.getMetadataArtifact().getModuleRevisionId();
        } else if (ivyRef.getRevision() == null || ivyRef.getRevision().length() == 0) {
            resolvedMrid = ModuleRevisionId.newInstance(resolvedMrid, "[email protected]" + getName());
        } else {
            resolvedMrid = ModuleRevisionId.newInstance(resolvedMrid, ivyRef.getRevision());
        }
    }
    if (isDynamic) {
        Message.verbose("\t\t[" + toSystem(resolvedMrid).getRevision() + "] "
                + dependencyConstraint.getModuleId());
    }
    systemMd.setResolvedModuleRevisionId(resolvedMrid);
    checkModuleDescriptorRevision(systemMd, dependencyConstraint);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:26,代码来源:BasicResolver.java

示例4: getDependency

import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private ModuleRevisionId getDependency(DependencyDescriptor dd) {
    ModuleRevisionId askedMrid = dd.getDependencyRevisionId();
    VersionMatcher vmatcher = settings.getVersionMatcher();
    if (vmatcher.isDynamic(askedMrid)) {
        ModuleRevisionId mrid = cache.get(askedMrid);
        if (mrid == null) {
            for (ModuleDescriptor md : getAllRevisions(askedMrid)) {
                if (vmatcher.needModuleDescriptor(askedMrid, md.getResolvedModuleRevisionId())) {
                    if (vmatcher.accept(askedMrid, md)) {
                        mrid = md.getResolvedModuleRevisionId();
                        break;
                    }
                } else {
                    if (vmatcher.accept(askedMrid, md.getResolvedModuleRevisionId())) {
                        mrid = md.getResolvedModuleRevisionId();
                        break;
                    }
                }
            }
            if (mrid == null) {
                return null;
            } else {
                cache.put(askedMrid, mrid);
            }
        }
        return mrid;
    } else {
        return askedMrid;
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:31,代码来源:RepositoryManagementEngine.java


注:本文中的org.apache.ivy.core.module.descriptor.ModuleDescriptor.getResolvedModuleRevisionId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。