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

Java ResolvedModuleRevision类代码示例

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

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



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

示例1: getDependency

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
public ResolvedModuleRevision getDependency(final DependencyDescriptor dd, final ResolveData data) throws ParseException {
    final DependencyResolver loopback = this;
    return cacheLockingManager.useCache(String.format("Resolve %s", dd), new Factory<ResolvedModuleRevision>() {
        public ResolvedModuleRevision create() {
            DefaultBuildableComponentResolveResult result = new DefaultBuildableComponentResolveResult();
            DefaultDependencyMetaData dependency = new DefaultDependencyMetaData(dd);
            IvyContext ivyContext = IvyContext.pushNewCopyContext();
            try {
                ivyContext.setResolveData(data);
                dependencyResolver.resolve(dependency, result);
            } finally {
                IvyContext.popContext();
            }
            return new ResolvedModuleRevision(loopback, loopback, result.getMetaData().getDescriptor(), null);
        }
    });
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:LoopbackDependencyResolver.java


示例2: cacheModuleDescriptor

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
public ResolvedModuleRevision cacheModuleDescriptor(DependencyResolver resolver, ResolvedResource resolvedResource, DependencyDescriptor dd, Artifact moduleArtifact, ResourceDownloader downloader, CacheMetadataOptions options) throws ParseException {
    if (!moduleArtifact.isMetadata()) {
        return null;
    }

    assert resolvedResource.getResource().isLocal();
    File file = new File(resolvedResource.getResource().getName());
    assert file.isFile();

    ArtifactOrigin origin = new ArtifactOrigin(moduleArtifact, true, file.getAbsolutePath());
    MetadataArtifactDownloadReport report = new MetadataArtifactDownloadReport(moduleArtifact);
    report.setDownloadStatus(DownloadStatus.NO);
    report.setArtifactOrigin(origin);
    report.setSize(file.length());
    report.setLocalFile(file);
    report.setSearched(false);
    report.setOriginalLocalFile(file);

    ModuleDescriptor descriptor = parseModuleDescriptor(resolver, moduleArtifact, options, file, resolvedResource.getResource());
    return new ResolvedModuleRevision(resolver, resolver, descriptor, report);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:22,代码来源:LocalFileRepositoryCacheManager.java


示例3: getDependency

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
public void getDependency(DependencyMetaData dependency, BuildableModuleVersionMetaDataResolveResult result) {
    IvyContext.getContext().setResolveData(resolveData);
    try {
        ResolvedModuleRevision revision = resolver.getDependency(dependency.getDescriptor(), resolveData);
        if (revision == null) {
            LOGGER.debug("Performed resolved of module '{}' in repository '{}': not found", dependency.getRequested(), getName());
            result.missing();
        } else {
            LOGGER.debug("Performed resolved of module '{}' in repository '{}': found", dependency.getRequested(), getName());
            ModuleDescriptorAdapter metaData = new ModuleDescriptorAdapter(revision.getDescriptor());
            metaData.setChanging(isChanging(revision));
            result.resolved(metaData, null);
        }
    } catch (ParseException e) {
        throw UncheckedException.throwAsUncheckedException(e);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:IvyDependencyResolverAdapter.java


示例4: findAllArtifactOnRefresh

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
/**
 * Populate the map of artifact. The map should be populated by metadata in cache as this is
 * called in the refresh process.
 *
 * @param ivy Ivy
 * @param parser XmlReportParser
 * @param result ResolveResult
 * @throws ParseException if parser fails
 */
private void findAllArtifactOnRefresh(Ivy ivy, XmlReportParser parser, ResolveResult result)
        throws ParseException {
    ModuleRevisionId[] dependencyMrids = parser.getDependencyRevisionIds();
    IvyDEMessage.verbose("Resolve report parsed. Fetching artifacts of "
            + dependencyMrids.length + " dependencie(s)");
    for (ModuleRevisionId dependencyMrid : dependencyMrids) {
        DependencyResolver depResolver = ivy.getSettings().getResolver(dependencyMrid);
        DefaultDependencyDescriptor depDescriptor = new DefaultDependencyDescriptor(
                dependencyMrid, false);
        ResolveOptions options = new ResolveOptions();
        options.setRefresh(true);
        options.setUseCacheOnly(true);
        IvyDEMessage.debug("Fetching dependency " + dependencyMrid);
        ResolvedModuleRevision dependency = depResolver.getDependency(depDescriptor,
            new ResolveData(ivy.getResolveEngine(), options));
        if (dependency != null) {
            Artifact[] artifacts = dependency.getDescriptor().getAllArtifacts();
            IvyDEMessage.debug("Dependency " + dependencyMrid + " found: "
                    + artifacts.length + " artifact(s) found");
            result.putArtifactsForDep(dependencyMrid, artifacts);
        } else {
            IvyDEMessage.debug("Dependency " + dependencyMrid + " not found");
        }
    }
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:35,代码来源:IvyResolver.java


示例5: getImplMrid

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
private ModuleRevisionId getImplMrid(ArtifactInfo o) {
    if (!(o instanceof MDResolvedResource)) {
        return null;
    }
    MDResolvedResource mdrr = (MDResolvedResource) o;
    ResolvedModuleRevision rmr = mdrr.getResolvedModuleRevision();
    if (rmr == null) {
        return null;
    }
    ModuleDescriptor md = rmr.getDescriptor();
    if (md == null) {
        return null;
    }
    if (!md.getModuleRevisionId().getOrganisation().equals(BundleInfo.PACKAGE_TYPE)) {
        return null;
    }
    DependencyDescriptor[] dds = md.getDependencies();
    if (dds == null || dds.length != 1) {
        return null;
    }
    return dds[0].getDependencyRevisionId();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:23,代码来源:OsgiLatestStrategy.java


示例6: EndResolveDependencyEvent

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
public EndResolveDependencyEvent(DependencyResolver resolver, DependencyDescriptor dd,
        ModuleRevisionId requestedRevisionId, ResolvedModuleRevision module, long duration) {
    super(NAME, resolver, dd, requestedRevisionId);
    this.module = module;
    this.duration = duration;
    addAttribute("duration", String.valueOf(duration));
    if (this.module != null) {
        // override revision from the dependency descriptor
        addAttribute("revision", this.module.getDescriptor().getResolvedModuleRevisionId()
                .getRevision());
        // now that we have loaded the dependency descriptor, we can put the extra attributes
        // contained in the descriptor too
        addAttributes(this.module.getDescriptor().getResolvedModuleRevisionId()
                .getQualifiedExtraAttributes());
        addAttributes(this.module.getDescriptor().getResolvedModuleRevisionId()
                .getExtraAttributes());

        addAttribute("resolved", "true");
    } else {
        addAttribute("resolved", "false");
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:23,代码来源:EndResolveDependencyEvent.java


示例7: addTo

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
private void addTo(PomModuleDescriptorBuilder mdBuilder, PomDependencyMgt dep,
        ParserSettings ivySettings) throws ParseException, IOException {
    if ("import".equals(dep.getScope())) {
        ModuleRevisionId importModRevID = ModuleRevisionId.newInstance(dep.getGroupId(),
            dep.getArtifactId(), dep.getVersion());
        ResolvedModuleRevision importModule = parseOtherPom(ivySettings, importModRevID);
        if (importModule == null) {
            throw new IOException("Impossible to import module for "
                    + mdBuilder.getModuleDescriptor().getResource().getName() + ". Import="
                    + importModRevID);
        }
        ModuleDescriptor importDescr = importModule.getDescriptor();

        // add dependency management info from imported module
        for (PomDependencyMgt importedDepMgt : getDependencyManagements(importDescr)) {
            mdBuilder.addDependencyMgt(new DefaultPomDependencyMgt(importedDepMgt.getGroupId(),
                    importedDepMgt.getArtifactId(), importedDepMgt.getVersion(),
                    importedDepMgt.getScope(), importedDepMgt.getExcludedModules()));
        }
    } else {
        mdBuilder.addDependencyMgt(dep);
    }

}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:25,代码来源:PomModuleDescriptorParser.java


示例8: getRMDParser

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
protected ResourceMDParser getRMDParser(final DependencyDescriptor dd, final ResolveData data) {
    return new ResourceMDParser() {
        public MDResolvedResource parse(Resource resource, String rev) {
            try {
                ResolvedModuleRevision rmr = BasicResolver.this.parse(new ResolvedResource(
                        resource, rev), dd, data);
                if (rmr != null) {
                    return new MDResolvedResource(resource, rev, rmr);
                }
            } catch (ParseException e) {
                Message.warn("Failed to parse the file '" + resource + "'", e);
            }
            return null;
        }

    };
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:18,代码来源:BasicResolver.java


示例9: testArtifactRef

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testArtifactRef() throws ParseException {

    // Simple Dependency for ibiblio
    ModuleRevisionId mrid1 = ModuleRevisionId.newInstance("log4j", "log4j", "1.2.16");
    ResolvedModuleRevision rmr1 = chain.getDependency(new DefaultDependencyDescriptor(mrid1,
            false), data);

    // Simple Dependency for updatesite
    ModuleRevisionId mrid2 = ModuleRevisionId.newInstance(BundleInfo.BUNDLE_TYPE,
        "org.apache.ivy", "2.0.0.final_20090108225011");
    ResolvedModuleRevision rmr2 = chain.getDependency(new DefaultDependencyDescriptor(mrid2,
            false), data);

    assertNotNull(rmr1);
    assertNotNull(rmr2);

    Artifact[] artifacts1 = rmr1.getDescriptor().getArtifacts("default");
    Artifact[] artifacts2 = rmr2.getDescriptor().getArtifacts("default");

    chain.exists(artifacts2[0]);
    chain.exists(artifacts1[0]);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:24,代码来源:UpdateSiteAndIbiblioResolverTest.java


示例10: testRelativePath

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

    resolver.addIvyPattern(new File("src/java").getAbsolutePath() + "/../../" + REL_IVY_PATTERN);
    resolver.addArtifactPattern(settings.getBaseDir() + "/src/../test/repositories/1/"
            + "[organisation]/[module]/[type]s/[artifact]-[revision].[type]");

    resolver.setLatestStrategy(new LatestRevisionStrategy());

    ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "2.0");
    ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org1", "mod1.1", "latest.integration"), false), data);
    assertNotNull(rmr);

    assertEquals(mrid, rmr.getId());
    Date pubdate = new GregorianCalendar(2005, 1, 15, 11, 0, 0).getTime();
    assertEquals(pubdate, rmr.getPublicationDate());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:23,代码来源:FileSystemResolverTest.java


示例11: testResolve

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testResolve() throws Exception {
    DualResolver dual = new DualResolver();
    MockResolver ivyResolver = MockResolver.buildMockResolver(settings, "ivy", true,
        new GregorianCalendar(2005, 1, 20).getTime());
    MockResolver artifactResolver = MockResolver.buildMockResolver(settings, "artifact",
        false, new GregorianCalendar(2005, 1, 20).getTime());
    dual.setIvyResolver(ivyResolver);
    dual.setArtifactResolver(artifactResolver);
    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org", "mod", "rev"), false);
    ResolvedModuleRevision rmr = dual.getDependency(dd, data);

    assertNotNull(rmr);
    assertEquals(dual, rmr.getArtifactResolver());
    assertEquals(Collections.<DependencyDescriptor> singletonList(dd), ivyResolver.askedDeps);
    assertTrue(artifactResolver.askedDeps.isEmpty());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:19,代码来源:DualResolverTest.java


示例12: testResolveFromArtifact

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testResolveFromArtifact() throws Exception {
    DualResolver dual = new DualResolver();
    MockResolver ivyResolver = MockResolver.buildMockResolver(settings, "ivy", false,
        new GregorianCalendar(2005, 1, 20).getTime());
    MockResolver artifactResolver = MockResolver.buildMockResolver(settings, "artifact", true,
        new GregorianCalendar(2005, 1, 20).getTime());
    dual.setIvyResolver(ivyResolver);
    dual.setArtifactResolver(artifactResolver);
    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org", "mod", "rev"), false);
    ResolvedModuleRevision rmr = dual.getDependency(dd, data);

    assertNotNull(rmr);
    assertEquals(artifactResolver, rmr.getResolver());
    assertEquals(Collections.<DependencyDescriptor> singletonList(dd), ivyResolver.askedDeps);
    assertEquals(Collections.<DependencyDescriptor> singletonList(dd), artifactResolver.askedDeps);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:19,代码来源:DualResolverTest.java


示例13: testResolveFail

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testResolveFail() throws Exception {
    DualResolver dual = new DualResolver();
    MockResolver ivyResolver = MockResolver.buildMockResolver(settings, "ivy", false,
        new GregorianCalendar(2005, 1, 20).getTime());
    MockResolver artifactResolver = MockResolver.buildMockResolver(settings, "artifact",
        false, new GregorianCalendar(2005, 1, 20).getTime());
    dual.setIvyResolver(ivyResolver);
    dual.setArtifactResolver(artifactResolver);
    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org", "mod", "rev"), false);
    ResolvedModuleRevision rmr = dual.getDependency(dd, data);

    assertNull(rmr);
    assertEquals(Collections.<DependencyDescriptor> singletonList(dd), ivyResolver.askedDeps);
    assertEquals(Collections.<DependencyDescriptor> singletonList(dd), artifactResolver.askedDeps);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:18,代码来源:DualResolverTest.java


示例14: testResolveOrder

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testResolveOrder() throws Exception {
    ChainResolver chain = new ChainResolver();
    chain.setName("chain");
    chain.setSettings(settings);
    MockResolver[] resolvers = new MockResolver[] {
            MockResolver.buildMockResolver(settings, "1", false, null),
            MockResolver.buildMockResolver(settings, "2", true, null),
            MockResolver.buildMockResolver(settings, "3", true, null)};
    for (MockResolver resolver : resolvers) {
        chain.add(resolver);
    }
    assertResolversSizeAndNames(chain, resolvers.length);

    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org", "mod", "rev"), false);
    ResolvedModuleRevision rmr = chain.getDependency(dd, data);
    assertNotNull(rmr);
    assertEquals("2", rmr.getResolver().getName());
    assertEquals(Collections.<DependencyDescriptor> singletonList(dd), resolvers[0].askedDeps);
    assertEquals(Collections.<DependencyDescriptor> singletonList(dd), resolvers[1].askedDeps);
    assertTrue(resolvers[2].askedDeps.isEmpty());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:24,代码来源:ChainResolverTest.java


示例15: testFormattedLatestRevision

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

    resolver.addIvyPattern(IVY_PATTERN);
    resolver.addArtifactPattern(settings.getBaseDir() + "/test/repositories/1/"
            + "[organisation]/[module]/[type]s/[artifact]-[revision].[type]");

    resolver.setLatestStrategy(new LatestRevisionStrategy());

    ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "1.1");
    ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org1", "mod1.1", "1+"), false), data);
    assertNotNull(rmr);

    assertEquals(mrid, rmr.getId());
    Date pubdate = new GregorianCalendar(2005, 0, 2, 11, 0, 0).getTime();
    assertEquals(pubdate, rmr.getPublicationDate());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:23,代码来源:FileSystemResolverTest.java


示例16: testReturnFirstWithDefaultAndCacheAndRealResolver

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
/**
 * Test case for IVY-389.
 *
 * @throws Exception if something goes wrong
 * @see <a href="https://issues.apache.org/jira/browse/IVY-389">IVY-389</a>
 */
@Test
public void testReturnFirstWithDefaultAndCacheAndRealResolver() throws Exception {
    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org1", "mod1.1", "1.0"), false);

    // 1 ---- we first do a first resolve which puts a default file in cache
    chainToPutDefaultModuleInCache().getDependency(dd, data);

    // 2 ---- now we ask to resolve dependencies with a chain in return first mode with check
    // modified = false, in which the first resolver is not able to find the module, but the
    // second is
    ChainResolver chain = returnFirstChain();

    ResolvedModuleRevision rmr = chain.getDependency(dd, data);
    assertNotNull(rmr);
    // the module returned should be the default one found in cache since check modified is
    // false
    assertEquals(true, rmr.getDescriptor().isDefault());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:26,代码来源:ChainResolverTest.java


示例17: testReturnFirstWithCheckModifiedAndDefaultAndCacheAndRealResolver

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
/**
 * Test case for IVY-207.
 *
 * @throws Exception if something goes wrong
 * @see <a href="https://issues.apache.org/jira/browse/IVY-207">IVY-207</a>
 */
@Test
public void testReturnFirstWithCheckModifiedAndDefaultAndCacheAndRealResolver()
        throws Exception {
    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org1", "mod1.1", "1.0"), false);

    // 1 ---- we first do a first resolve which puts a default file in cache
    chainToPutDefaultModuleInCache().getDependency(dd, data);

    // 2 ---- now we ask to resolve dependencies with a chain in return first mode, in which the
    // first resolver is not able to find the module, but the second is
    ChainResolver chain = returnFirstChain();
    chain.setCheckmodified(true);

    ResolvedModuleRevision rmr = chain.getDependency(dd, data);
    assertNotNull(rmr);
    assertEquals(false, rmr.getDescriptor().isDefault());
    assertEquals("2", rmr.getResolver().getName());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:26,代码来源:ChainResolverTest.java


示例18: testDual

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testDual() throws Exception {
    ChainResolver chain = new ChainResolver();
    chain.setName("chain");
    chain.setSettings(settings);
    chain.setDual(true);
    MockResolver[] resolvers = new MockResolver[] {
            MockResolver.buildMockResolver(settings, "1", false, null),
            MockResolver.buildMockResolver(settings, "2", true, null),
            MockResolver.buildMockResolver(settings, "3", true, null)};
    for (MockResolver resolver : resolvers) {
        chain.add(resolver);
    }
    assertResolversSizeAndNames(chain, resolvers.length);

    DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org", "mod", "rev"), false);
    ResolvedModuleRevision rmr = chain.getDependency(dd, data);
    assertNotNull(rmr);
    assertEquals("2", rmr.getResolver().getName());
    assertEquals("chain", rmr.getArtifactResolver().getName());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:23,代码来源:ChainResolverTest.java


示例19: testLatestFile

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testLatestFile() throws Exception {
    URLResolver resolver = new URLResolver();
    resolver.setSettings(settings);
    String rootpath = new File("test/repositories/1").toURI().toURL().toExternalForm();
    resolver.addIvyPattern(rootpath + "[organisation]/[module]/ivys/ivy-[revision].xml");
    resolver.addArtifactPattern(rootpath
            + "[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
    resolver.setName("test");
    assertEquals("test", resolver.getName());

    ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "2.0");
    ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org1", "mod1.1", "latest.integration"), false), data);
    assertNotNull(rmr);

    assertEquals(mrid, rmr.getId());
    Date pubdate = new GregorianCalendar(2005, 1, 15, 11, 0, 0).getTime();
    assertEquals(pubdate, rmr.getPublicationDate());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:21,代码来源:URLResolverTest.java


示例20: testLatestFileWithOpaqueURL

import org.apache.ivy.core.resolve.ResolvedModuleRevision; //导入依赖的package包/类
@Test
public void testLatestFileWithOpaqueURL() throws Exception {
    URLResolver resolver = new URLResolver();
    resolver.setSettings(settings);
    String rootpath = new File("test/repositories/1").getAbsoluteFile().toURI().toURL()
            .toExternalForm();
    resolver.addIvyPattern(rootpath + "/[organisation]/[module]/ivys/ivy-[revision].xml");
    resolver.addArtifactPattern(rootpath
            + "/[organisation]/[module]/[type]s/[artifact]-[revision].[type]");
    resolver.setName("test");
    assertEquals("test", resolver.getName());

    ModuleRevisionId mrid = ModuleRevisionId.newInstance("org1", "mod1.1", "2.0");
    ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(
            ModuleRevisionId.newInstance("org1", "mod1.1", "latest.integration"), false), data);
    assertNotNull(rmr);

    assertEquals(mrid, rmr.getId());
    Date pubdate = new GregorianCalendar(2005, 1, 15, 11, 0, 0).getTime();
    assertEquals(pubdate, rmr.getPublicationDate());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:22,代码来源:URLResolverTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java RuleData类代码示例发布时间:2022-05-23
下一篇:
Java AccessibleExtendedComponent类代码示例发布时间: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