• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ArtifactId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.ivy.core.module.id.ArtifactId的典型用法代码示例。如果您正苦于以下问题:Java ArtifactId类的具体用法?Java ArtifactId怎么用?Java ArtifactId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ArtifactId类属于org.apache.ivy.core.module.id包,在下文中一共展示了ArtifactId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toExcludeRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
private static DefaultExcludeRule toExcludeRule(JkDepExclude depExclude, Iterable<String> allRootConfs) {
    final String type = depExclude.type() == null ? PatternMatcher.ANY_EXPRESSION : depExclude
            .type();
    final String ext = depExclude.ext() == null ? PatternMatcher.ANY_EXPRESSION : depExclude
            .ext();
    final ArtifactId artifactId = new ArtifactId(toModuleId(depExclude.moduleId()), "*", type,
            ext);
    final DefaultExcludeRule result = new DefaultExcludeRule(artifactId,
            ExactPatternMatcher.INSTANCE, null);
    for (final JkScope scope : depExclude.getScopes()) {
        result.addConfiguration(scope.name());
    }
    if (depExclude.getScopes().isEmpty()) {
        for (final String conf : allRootConfs) {
            result.addConfiguration(conf);
        }

    }
    return result;
}
 
开发者ID:jerkar,项目名称:jerkar,代码行数:21,代码来源:IvyTranslations.java


示例2: createExcludeRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public DefaultExcludeRule createExcludeRule(String configurationName, ExcludeRule excludeRule) {
    String org = GUtil.elvis(excludeRule.getGroup(), PatternMatcher.ANY_EXPRESSION);
    String module = GUtil.elvis(excludeRule.getModule(), PatternMatcher.ANY_EXPRESSION);
    DefaultExcludeRule ivyExcludeRule = new DefaultExcludeRule(new ArtifactId(
            IvyUtil.createModuleId(org, module), PatternMatcher.ANY_EXPRESSION,
            PatternMatcher.ANY_EXPRESSION,
            PatternMatcher.ANY_EXPRESSION),
            ExactPatternMatcher.INSTANCE, null);
    ivyExcludeRule.addConfiguration(configurationName);
    return ivyExcludeRule;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:12,代码来源:DefaultExcludeRuleConverter.java


示例3: asRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
DefaultExcludeRule asRule(IvySettings settings) {
    String matcherName = (matcher == null) ? PatternMatcher.EXACT : matcher;
    String orgPattern = (org == null) ? PatternMatcher.ANY_EXPRESSION : org;
    String modulePattern = (module == null) ? PatternMatcher.ANY_EXPRESSION : module;
    String namePattern = (name == null) ? PatternMatcher.ANY_EXPRESSION : name;
    String typePattern = (type == null) ? PatternMatcher.ANY_EXPRESSION : type;
    String extPattern = (ext == null) ? typePattern : ext;
    ArtifactId aid = new ArtifactId(new ModuleId(orgPattern, modulePattern), namePattern,
            typePattern, extPattern);
    return new DefaultExcludeRule(aid, settings.getMatcher(matcherName), null);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:12,代码来源:IvyDependencyExclude.java


示例4: asRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
DefaultIncludeRule asRule(IvySettings settings) {
    String matcherName = matcher == null ? PatternMatcher.EXACT : matcher;
    String namePattern = name == null ? PatternMatcher.ANY_EXPRESSION : name;
    String typePattern = type == null ? PatternMatcher.ANY_EXPRESSION : type;
    String extPattern = ext == null ? typePattern : ext;
    ArtifactId aid = new ArtifactId(new ModuleId(PatternMatcher.ANY_EXPRESSION,
            PatternMatcher.ANY_EXPRESSION), namePattern, typePattern, extPattern);
    return new DefaultIncludeRule(aid, settings.getMatcher(matcherName), null);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:10,代码来源:IvyDependencyInclude.java


示例5: asRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
DefaultExcludeRule asRule(IvySettings settings) {
    String matcherName = (matcher == null) ? PatternMatcher.EXACT : matcher;
    String orgPattern = (org == null) ? PatternMatcher.ANY_EXPRESSION : org;
    String modulePattern = (module == null) ? PatternMatcher.ANY_EXPRESSION : module;
    String artifactPattern = (artifact == null) ? PatternMatcher.ANY_EXPRESSION : artifact;
    String typePattern = (type == null) ? PatternMatcher.ANY_EXPRESSION : type;
    String extPattern = (ext == null) ? typePattern : ext;
    ArtifactId aid = new ArtifactId(new ModuleId(orgPattern, modulePattern), artifactPattern,
            typePattern, extPattern);
    return new DefaultExcludeRule(aid, settings.getMatcher(matcherName), null);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:12,代码来源:IvyExclude.java


示例6: findArtifactsMatching

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
private static Collection<Artifact> findArtifactsMatching(IncludeRule rule,
        Map<ArtifactId, Artifact> allArtifacts) {
    Collection<Artifact> ret = new ArrayList<>();
    for (Map.Entry<ArtifactId, Artifact> entry : allArtifacts.entrySet()) {
        if (MatcherHelper.matches(rule.getMatcher(), rule.getId(), entry.getKey())) {
            ret.add(entry.getValue());
        }
    }
    return ret;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:IvyNode.java


示例7: doesExclude

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
/**
 * only works when namespace is properly set. The behaviour is not specified if namespace is not
 * set.
 *
 * @param moduleConfigurations String[]
 * @param artifactId ditto
 * @return boolean
 */
public boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId) {
    if (namespace != null) {
        artifactId = NameSpaceHelper
                .transform(artifactId, namespace.getFromSystemTransformer());
    }
    for (ExcludeRule rule : getExcludeRules(moduleConfigurations)) {
        if (MatcherHelper.matches(rule.getMatcher(), rule.getId(), artifactId)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:21,代码来源:DefaultDependencyDescriptor.java


示例8: doesExclude

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
/**
 * Only works when namespace is properly set. The behaviour is not specified if namespace is
 * not set.
 *
 * @param moduleConfigurations String[]
 * @param artifactId ditto
 * @return boolean
 */
public boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId) {
    if (namespace != null) {
        artifactId = NameSpaceHelper
                .transform(artifactId, namespace.getFromSystemTransformer());
    }
    for (ExcludeRule rule : getExcludeRules(moduleConfigurations)) {
        if (MatcherHelper.matches(rule.getMatcher(), rule.getId(), artifactId)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:21,代码来源:DefaultModuleDescriptor.java


示例9: AbstractIncludeExcludeRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public AbstractIncludeExcludeRule(ArtifactId aid, PatternMatcher matcher,
                                  Map<String, String> extraAttributes) {
    super(null, extraAttributes);
    id = aid;
    patternMatcher = matcher;
    initStandardAttributes();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:8,代码来源:AbstractIncludeExcludeRule.java


示例10: transform

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public static ArtifactId transform(ArtifactId artifactId, NamespaceTransformer t) {
    if (t.isIdentity()) {
        return artifactId;
    }
    ModuleId mid = transform(artifactId.getModuleId(), t);
    if (mid.equals(artifactId.getModuleId())) {
        return artifactId;
    }
    return new ArtifactId(mid, artifactId.getName(), artifactId.getType(), artifactId.getExt());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:11,代码来源:NameSpaceHelper.java


示例11: addArtifact

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public void addArtifact(String groupId, String artifactId, String version) throws Exception {
	String[] dep = null;
	dep = new String[] { groupId, artifactId, version };
	if (md == null) {
		md = DefaultModuleDescriptor.newDefaultInstance(ModuleRevisionId.newInstance(dep[0], dep[1] + "-caller",
				"working"));
	}
	DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, ModuleRevisionId.newInstance(dep[0],
			dep[1], dep[2]), false, false, true);
	md.addDependency(dd);
	ExcludeRule er = new DefaultExcludeRule(new ArtifactId(new ModuleId("org.walkmod", "walkmod-core"),
			PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION),
			ExactPatternMatcher.INSTANCE, null);
	dd.addExcludeRule(null, er);
}
 
开发者ID:walkmod,项目名称:walkmod-core,代码行数:16,代码来源:IvyConfigurationProvider.java


示例12: forIvyExclude

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
private static Exclude forIvyExclude(org.apache.ivy.core.module.descriptor.ExcludeRule excludeRule) {
    ArtifactId id = excludeRule.getId();
    return new DefaultExclude(
        id.getModuleId().getOrganisation(), id.getModuleId().getName(), id.getName(), id.getType(), id.getExt(),
        excludeRule.getConfigurations(), excludeRule.getMatcher().getName());
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:7,代码来源:IvyModuleDescriptorConverter.java


示例13: addDependency

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public void addDependency(PomDependencyData dep) {
    String scope = dep.getScope();
    if ((scope != null) && (scope.length() > 0) && !MAVEN2_CONF_MAPPING.containsKey(scope)) {
        // unknown scope, defaulting to 'compile'
        scope = "compile";
    }

    String version = determineVersion(dep);
    ModuleRevisionId moduleRevId = IvyUtil.createModuleRevisionId(dep.getGroupId(), dep.getArtifactId(), version);

    // Some POMs depend on themselves, don't add this dependency: Ivy doesn't allow this!
    // Example: http://repo2.maven.org/maven2/net/jini/jsk-platform/2.1/jsk-platform-2.1.pom
    ModuleRevisionId mRevId = ivyModuleDescriptor.getModuleRevisionId();
    if ((mRevId != null) && mRevId.getModuleId().equals(moduleRevId.getModuleId())) {
        return;
    }

    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(ivyModuleDescriptor, moduleRevId, true, false, true);
    scope = (scope == null || scope.length() == 0) ? getDefaultScope(dep) : scope;
    ConfMapper mapping = MAVEN2_CONF_MAPPING.get(scope);
    mapping.addMappingConfs(dd, dep.isOptional());
    Map<String, String> extraAtt = new HashMap<String, String>();
    boolean hasClassifier = dep.getClassifier() != null && dep.getClassifier().length() > 0;
    boolean hasNonJarType = dep.getType() != null && !"jar".equals(dep.getType());
    if (hasClassifier || hasNonJarType) {
        String type = "jar";
        if (dep.getType() != null) {
            type = dep.getType();
        }
        String ext = determineExtension(type);
        handleSpecialTypes(type, extraAtt);

        // we deal with classifiers by setting an extra attribute and forcing the
        // dependency to assume such an artifact is published
        if (dep.getClassifier() != null) {
            extraAtt.put(EXTRA_ATTRIBUTE_CLASSIFIER, dep.getClassifier());
        }
        DefaultDependencyArtifactDescriptor depArtifact = new DefaultDependencyArtifactDescriptor(dd, dd.getDependencyId().getName(), type, ext, null, extraAtt);
        // here we have to assume a type and ext for the artifact, so this is a limitation
        // compared to how m2 behave with classifiers
        String optionalizedScope = dep.isOptional() ? "optional" : scope;
        dd.addDependencyArtifact(optionalizedScope, depArtifact);
    }

    // experimentation shows the following, excluded modules are
    // inherited from parent POMs if either of the following is true:
    // the <exclusions> element is missing or the <exclusions> element
    // is present, but empty.
    List /*<ModuleId>*/ excluded = dep.getExcludedModules();
    if (excluded.isEmpty()) {
        excluded = getDependencyMgtExclusions(dep);
    }
    for (Object anExcluded : excluded) {
        ModuleId excludedModule = (ModuleId) anExcluded;
        String[] confs = dd.getModuleConfigurations();
        for (String conf : confs) {
            dd.addExcludeRule(conf, new DefaultExcludeRule(new ArtifactId(
                    excludedModule, PatternMatcher.ANY_EXPRESSION,
                    PatternMatcher.ANY_EXPRESSION,
                    PatternMatcher.ANY_EXPRESSION),
                    ExactPatternMatcher.INSTANCE, null));
        }
    }

    ivyModuleDescriptor.addDependency(dd);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:67,代码来源:GradlePomModuleDescriptorBuilder.java


示例14: addDependency

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public void addDependency(PomDependencyData dep) {
    String scope = dep.getScope();
    if ((scope != null) && (scope.length() > 0) && !MAVEN2_CONF_MAPPING.containsKey(scope)) {
        // unknown scope, defaulting to 'compile'
        scope = "compile";
    }

    String version = determineVersion(dep);
    ModuleRevisionId moduleRevId = IvyUtil.createModuleRevisionId(dep.getGroupId(), dep.getArtifactId(), version);

    // Some POMs depend on themselves, don't add this dependency: Ivy doesn't allow this!
    // Example: http://repo2.maven.org/maven2/net/jini/jsk-platform/2.1/jsk-platform-2.1.pom
    ModuleRevisionId mRevId = ivyModuleDescriptor.getModuleRevisionId();
    if ((mRevId != null) && mRevId.getModuleId().equals(moduleRevId.getModuleId())) {
        return;
    }

    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(ivyModuleDescriptor, moduleRevId, true, false, true);
    scope = (scope == null || scope.length() == 0) ? getDefaultScope(dep) : scope;
    ConfMapper mapping = MAVEN2_CONF_MAPPING.get(scope);
    mapping.addMappingConfs(dd, dep.isOptional());
    Map<String, String> extraAtt = new HashMap<String, String>();
    boolean hasClassifier = dep.getClassifier() != null && dep.getClassifier().length() > 0;
    boolean hasNonJarType = dep.getType() != null && !"jar".equals(dep.getType());
    if (hasClassifier || hasNonJarType) {
        String type = "jar";
        if (dep.getType() != null) {
            type = dep.getType();
        }
        String ext = type;

        // if type is 'test-jar', the extension is 'jar' and the classifier is 'tests'
        // Cfr. http://maven.apache.org/guides/mini/guide-attached-tests.html
        if ("test-jar".equals(type)) {
            ext = "jar";
            extraAtt.put("m:classifier", "tests");
        } else if (JAR_PACKAGINGS.contains(type)) {
            ext = "jar";
        }

        // we deal with classifiers by setting an extra attribute and forcing the
        // dependency to assume such an artifact is published
        if (dep.getClassifier() != null) {
            extraAtt.put("m:classifier", dep.getClassifier());
        }
        DefaultDependencyArtifactDescriptor depArtifact = new DefaultDependencyArtifactDescriptor(dd, dd.getDependencyId().getName(), type, ext, null, extraAtt);
        // here we have to assume a type and ext for the artifact, so this is a limitation
        // compared to how m2 behave with classifiers
        String optionalizedScope = dep.isOptional() ? "optional" : scope;
        dd.addDependencyArtifact(optionalizedScope, depArtifact);
    }

    // experimentation shows the following, excluded modules are
    // inherited from parent POMs if either of the following is true:
    // the <exclusions> element is missing or the <exclusions> element
    // is present, but empty.
    List /*<ModuleId>*/ excluded = dep.getExcludedModules();
    if (excluded.isEmpty()) {
        excluded = getDependencyMgtExclusions(dep);
    }
    for (Object anExcluded : excluded) {
        ModuleId excludedModule = (ModuleId) anExcluded;
        String[] confs = dd.getModuleConfigurations();
        for (String conf : confs) {
            dd.addExcludeRule(conf, new DefaultExcludeRule(new ArtifactId(
                    excludedModule, PatternMatcher.ANY_EXPRESSION,
                    PatternMatcher.ANY_EXPRESSION,
                    PatternMatcher.ANY_EXPRESSION),
                    ExactPatternMatcher.INSTANCE, null));
        }
    }

    ivyModuleDescriptor.addDependency(dd);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:75,代码来源:GradlePomModuleDescriptorBuilder.java


示例15: getId

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public ArtifactId getId() {
    return id;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:4,代码来源:AbstractIncludeExcludeRule.java


示例16: DefaultIncludeRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public DefaultIncludeRule(ArtifactId aid, PatternMatcher matcher, Map<String, String> extraAttributes) {
    super(aid, matcher, extraAttributes);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:4,代码来源:DefaultIncludeRule.java


示例17: DefaultExcludeRule

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public DefaultExcludeRule(ArtifactId aid, PatternMatcher matcher, Map<String, String> extraAttributes) {
    super(aid, matcher, extraAttributes);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:4,代码来源:DefaultExcludeRule.java


示例18: matches

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
public static boolean matches(PatternMatcher m, ArtifactId exp, ArtifactId aid) {
    return matches(m, exp.getModuleId(), aid.getModuleId())
            && matches(m, exp.getName(), aid.getName())
            && matches(m, exp.getExt(), aid.getExt())
            && matches(m, exp.getType(), aid.getType());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:7,代码来源:MatcherHelper.java


示例19: testBintrayArtifacts

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
@Test
public void testBintrayArtifacts() throws Exception {
    BintrayResolver resolver = new BintrayResolver();
    resolver.setName("test");
    resolver.setSettings(settings);
    assertEquals("test", resolver.getName());

    ModuleRevisionId mrid = ModuleRevisionId
            .newInstance("org.apache.ant", "ant-antunit", "1.2");
    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(mrid, false);
    dd.addIncludeRule("default", new DefaultIncludeRule(new ArtifactId(mrid.getModuleId(),
            "ant-antunit", "javadoc", "jar"), ExactPatternMatcher.INSTANCE, null));
    dd.addIncludeRule("default", new DefaultIncludeRule(new ArtifactId(mrid.getModuleId(),
            "ant-antunit", "sources", "jar"), ExactPatternMatcher.INSTANCE, null));
    ResolvedModuleRevision rmr = resolver.getDependency(dd, data);
    assertNotNull(rmr);
    assertEquals(mrid, rmr.getId());

    DefaultArtifact profiler = new DefaultArtifact(mrid, rmr.getPublicationDate(),
            "ant-antunit", "javadoc", "jar");
    DefaultArtifact trace = new DefaultArtifact(mrid, rmr.getPublicationDate(), "ant-antunit",
            "sources", "jar");
    DownloadReport report = resolver.download(new Artifact[] {profiler, trace},
        downloadOptions());
    assertNotNull(report);

    assertEquals(2, report.getArtifactsReports().length);

    ArtifactDownloadReport ar = report.getArtifactReport(profiler);
    assertNotNull(ar);

    assertEquals(profiler, ar.getArtifact());
    assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());

    ar = report.getArtifactReport(trace);
    assertNotNull(ar);

    assertEquals(trace, ar.getArtifact());
    assertEquals(DownloadStatus.SUCCESSFUL, ar.getDownloadStatus());

    // test to ask to download again, should use cache
    report = resolver.download(new Artifact[] {profiler, trace}, downloadOptions());
    assertNotNull(report);

    assertEquals(2, report.getArtifactsReports().length);

    ar = report.getArtifactReport(profiler);
    assertNotNull(ar);

    assertEquals(profiler, ar.getArtifact());
    assertEquals(DownloadStatus.NO, ar.getDownloadStatus());

    ar = report.getArtifactReport(trace);
    assertNotNull(ar);

    assertEquals(trace, ar.getArtifact());
    assertEquals(DownloadStatus.NO, ar.getDownloadStatus());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:59,代码来源:BintrayResolverTest.java


示例20: doesExclude

import org.apache.ivy.core.module.id.ArtifactId; //导入依赖的package包/类
/**
 * Returns true if
 *
 * @param moduleConfigurations ditto
 * @param artifactId ditto
 * @return boolean
 */
boolean doesExclude(String[] moduleConfigurations, ArtifactId artifactId);
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:DependencyDescriptor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RowConstructor类代码示例发布时间:2022-05-23
下一篇:
Java RelaxedNames类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap