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


Java ModuleId.newInstance方法代码示例

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


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

示例1: listModules

import org.apache.ivy.core.module.id.ModuleId; //导入方法依赖的package包/类
/**
 * List module ids of the module accessible through the current resolvers matching the given mid
 * criteria according to the given matcher.
 * <p>
 * ModuleId are returned in the system namespace.
 * </p>
 *
 * @param moduleCrit ModuleId
 * @param matcher PatternMatcher
 * @return ModuleId[]
 */
public ModuleId[] listModules(ModuleId moduleCrit, PatternMatcher matcher) {
    List<ModuleId> ret = new ArrayList<>();

    Map<String, Object> criteria = new HashMap<>();
    addMatcher(matcher, moduleCrit.getOrganisation(), criteria,
        IvyPatternHelper.ORGANISATION_KEY);
    addMatcher(matcher, moduleCrit.getName(), criteria, IvyPatternHelper.MODULE_KEY);

    String[] tokensToList = new String[] {IvyPatternHelper.ORGANISATION_KEY,
            IvyPatternHelper.MODULE_KEY};

    for (DependencyResolver resolver : settings.getResolvers()) {
        Map<String, String>[] moduleIdAsMap = resolver.listTokenValues(tokensToList, criteria);
        for (Map<String, String> moduleId : moduleIdAsMap) {
            String org = moduleId.get(IvyPatternHelper.ORGANISATION_KEY);
            String name = moduleId.get(IvyPatternHelper.MODULE_KEY);
            ModuleId modId = ModuleId.newInstance(org, name);
            ret.add(NameSpaceHelper.transform(modId, resolver.getNamespace()
                    .getToSystemTransformer()));
        }
    }

    return ret.toArray(new ModuleId[ret.size()]);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:36,代码来源:SearchEngine.java

示例2: getDefaultVersion

import org.apache.ivy.core.module.id.ModuleId; //导入方法依赖的package包/类
private String getDefaultVersion(PomDependencyData dep) {
    ModuleId moduleId = ModuleId.newInstance(dep.getGroupId(), dep.getArtifactId());
    if (ivyModuleDescriptor.getDependencyManagementMap().containsKey(moduleId)) {
        return ivyModuleDescriptor.getDependencyManagementMap().get(moduleId).getVersion();
    }
    String key = getDependencyMgtExtraInfoKeyForVersion(dep.getGroupId(), dep.getArtifactId());
    return ivyModuleDescriptor.getExtraInfoContentByTagName(key);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:PomModuleDescriptorBuilder.java

示例3: getDefaultScope

import org.apache.ivy.core.module.id.ModuleId; //导入方法依赖的package包/类
private String getDefaultScope(PomDependencyData dep) {
    String result;
    ModuleId moduleId = ModuleId.newInstance(dep.getGroupId(), dep.getArtifactId());
    if (ivyModuleDescriptor.getDependencyManagementMap().containsKey(moduleId)) {
        result = ivyModuleDescriptor.getDependencyManagementMap().get(moduleId).getScope();
    } else {
        String key = getDependencyMgtExtraInfoKeyForScope(dep.getGroupId(), dep.getArtifactId());
        result = ivyModuleDescriptor.getExtraInfoContentByTagName(key);
    }
    if (result == null || !MAVEN2_CONF_MAPPING.containsKey(result)) {
        result = "compile";
    }
    return result;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:15,代码来源:PomModuleDescriptorBuilder.java

示例4: createModuleId

import org.apache.ivy.core.module.id.ModuleId; //导入方法依赖的package包/类
public static ModuleId createModuleId(String org, String name) {
    synchronized (MODULE_ID_LOCK) {
        return ModuleId.newInstance(org, name);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:6,代码来源:IvyUtil.java

示例5: execute

import org.apache.ivy.core.module.id.ModuleId; //导入方法依赖的package包/类
public void execute() {
    ModuleId moduleId;
    if (organisation != null && module != null) {
        moduleId = ModuleId.newInstance(organisation, module);
    } else {
        throw new BuildException(
                "The module to import is not properly specified, you must set set organisation / module attributes");
    }
    String moduleName = moduleId.toString();
    if (!BuildConfigurationHelper.isBuildConfigurationActive(getBuildConfigurations(), getProject(), "module"
            + getModule())) {
        log("no matching build configuration for module " + moduleName + " this module will be skipped ",
                Project.MSG_DEBUG);
        return;
    }

    // if no as attribute was given use module name
    if (getAs() == null && "include".equals(getMode())) {
        if (getModule() != null) {
            setAs(getModule());
        }
    }

    // check if a property skip.${module} or skip.${as} is set
    boolean toBeSkipped = getProject().getProperty("skip." + moduleName) != null
            || getProject().getProperty("skip." + getAs()) != null;

    if (isMandatory() && toBeSkipped) {
        log("Impossible to skip a mandatory module : " + moduleName, Project.MSG_WARN);
    }
    // a module can be skipped *only* if it is not mandatory
    if (!isMandatory() && toBeSkipped) {
        log(moduleName + " skipped !");
    } else {

        ResolveReport importedModuleResolveReport = getProject().getReference(
                EasyAntMagicNames.IMPORTED_MODULES_RESOLVE_REPORT_REF);
        if (importedModuleResolveReport != null) {
            importModule(moduleId, importedModuleResolveReport);
        }
    }
}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:43,代码来源:ImportDeferred.java


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