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

Java Artifact类代码示例

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

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



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

示例1: deployEffectivePom

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
private void deployEffectivePom( ModuleRevisionId moduleRevisionId, Path artifactPath )
    throws IOException
{
    try
    {
        File pomFile = artifactPath.resolveSibling( artifactPath.getName( artifactPath.getNameCount() - 1 )
            + "-xmvn.pom" ).toFile();
        ModuleDescriptorParser parser = XmlModuleDescriptorParser.getInstance();
        ModuleDescriptor module =
            parser.parseDescriptor( getSettings(), artifactPath.toFile().toURI().toURL(), false );
        PomModuleDescriptorWriter.write( module, pomFile, new PomWriterOptions() );

        org.fedoraproject.xmvn.artifact.Artifact artifact = ivy2aether( moduleRevisionId, "pom" );
        deploy( artifact, null, artifactPath );
    }
    catch ( ParseException e )
    {
        throw new IOException( e );
    }
}
 
开发者ID:fedora-java,项目名称:xmvn,代码行数:21,代码来源:IvyResolver.java


示例2: populateModuleDescriptorWithPublication

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
static void populateModuleDescriptorWithPublication(DefaultModuleDescriptor descriptor,
        JkMavenPublication publication, Instant publishDate) {

    final ModuleRevisionId moduleRevisionId = descriptor.getModuleRevisionId();
    final String artifactName = moduleRevisionId.getName();
    final Artifact mavenMainArtifact = toPublishedMavenArtifact(publication.mainArtifactFiles()
            .get(0), artifactName, null, moduleRevisionId, publishDate);
    final String mainConf = "default";
    populateDescriptorWithMavenArtifact(descriptor, mainConf, mavenMainArtifact);

    for (final JkClassifiedFileArtifact artifactEntry : publication.classifiedArtifacts()) {
        final Path file = artifactEntry.file();
        final String classifier = artifactEntry.classifier();
        final Artifact mavenArtifact = toPublishedMavenArtifact(file, artifactName, classifier,
                descriptor.getModuleRevisionId(), publishDate);
        populateDescriptorWithMavenArtifact(descriptor, classifier, mavenArtifact);
    }
}
 
开发者ID:jerkar,项目名称:jerkar,代码行数:19,代码来源:IvyTranslations.java


示例3: populateArtifactsFromDescriptor

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
private void populateArtifactsFromDescriptor() {
    Map<Artifact, ModuleComponentArtifactMetaData> artifactToMetaData = Maps.newLinkedHashMap();
    for (Artifact descriptorArtifact : getDescriptor().getAllArtifacts()) {
        ModuleComponentArtifactMetaData artifact = artifact(descriptorArtifact);
        artifactToMetaData.put(descriptorArtifact, artifact);
    }

    artifacts = Sets.newLinkedHashSet(artifactToMetaData.values());

    this.artifactsByConfig = LinkedHashMultimap.create();
    for (String configuration : getDescriptor().getConfigurationsNames()) {
        Artifact[] configArtifacts = getDescriptor().getArtifacts(configuration);
        for (Artifact configArtifact : configArtifacts) {
            artifactsByConfig.put(configuration, artifactToMetaData.get(configArtifact));
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:AbstractModuleComponentResolveMetaData.java


示例4: addArtifact

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public void addArtifact(IvyArtifactName newArtifact, Set<String> configurations) {
    if (configurations.isEmpty()) {
        throw new IllegalArgumentException("Artifact should be attached to at least one configuration.");
    }

    MDArtifact unattached = new MDArtifact(module, newArtifact.getName(), newArtifact.getType(), newArtifact.getExtension(), null, newArtifact.getAttributes());
    //Adding the artifact will replace any existing artifact
    //This potentially leads to loss of information - the configurations of the replaced artifact are lost (see GRADLE-123)
    //Hence we attempt to find an existing artifact and merge the information
    Artifact[] allArtifacts = module.getAllArtifacts();
    for (Artifact existing : allArtifacts) {
        // Can't just compare the raw IvyArtifactName, since creating MDArtifact creates a bunch of attributes
        if (artifactsEqual(unattached, existing)) {
            if (!(existing instanceof MDArtifact)) {
                throw new IllegalArgumentException("Cannot update an existing artifact (" + existing + ") in provided module descriptor (" + module + ")"
                        + " because the artifact is not an instance of MDArtifact." + module);
            }
            attachArtifact((MDArtifact) existing, configurations, module);
            return; //there is only one matching artifact
        }
    }
    attachArtifact(unattached, configurations, module);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:24,代码来源:BuildableIvyModuleResolveMetaData.java


示例5: publish

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public void publish(IvyNormalizedPublication publication, PublicationAwareRepository repository) {
    ModuleVersionPublisher publisher = repository.createPublisher();
    IvyPublicationIdentity projectIdentity = publication.getProjectIdentity();
    ModuleRevisionId moduleRevisionId = IvyUtil.createModuleRevisionId(projectIdentity.getOrganisation(), projectIdentity.getModule(), projectIdentity.getRevision());
    ModuleVersionIdentifier moduleVersionIdentifier = DefaultModuleVersionIdentifier.newId(moduleRevisionId);
    DefaultIvyModulePublishMetaData publishMetaData = new DefaultIvyModulePublishMetaData(moduleVersionIdentifier);

    try {
        for (IvyArtifact publishArtifact : publication.getArtifacts()) {
            Artifact ivyArtifact = createIvyArtifact(publishArtifact, moduleRevisionId);
            publishMetaData.addArtifact(ivyArtifact, publishArtifact.getFile());
        }

        Artifact artifact = DefaultArtifact.newIvyArtifact(moduleRevisionId, null);
        publishMetaData.addArtifact(artifact, publication.getDescriptorFile());

        publisher.publish(publishMetaData);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:22,代码来源:DependencyResolverIvyPublisher.java


示例6: publish

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public void publish(ModuleVersionPublishMetaData moduleVersion) throws IOException {
    boolean successfullyPublished = false;
    try {
        ModuleVersionIdentifier id = moduleVersion.getId();
        ModuleRevisionId ivyId = IvyUtil.createModuleRevisionId(id.getGroup(), id.getName(), id.getVersion());
        resolver.beginPublishTransaction(ivyId, true);
        for (ModuleVersionArtifactPublishMetaData artifactMetaData : moduleVersion.getArtifacts()) {
            Artifact artifact = artifactMetaData.toIvyArtifact();
            File artifactFile = artifactMetaData.getFile();
            resolver.publish(artifact, artifactFile, true);
        }
        resolver.commitPublishTransaction();
        successfullyPublished = true;
    } finally {
        if (!successfullyPublished) {
            resolver.abortPublishTransaction();
        }
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:20,代码来源:IvyResolverBackedModuleVersionPublisher.java


示例7: createIvyArtifact

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public Artifact createIvyArtifact(PublishArtifact publishArtifact, ModuleRevisionId moduleRevisionId) {
    Map<String, String> extraAttributes = new HashMap<String, String>();
    if (GUtil.isTrue(publishArtifact.getClassifier())) {
        extraAttributes.put(Dependency.CLASSIFIER, publishArtifact.getClassifier());
    }
    String name = publishArtifact.getName();
    if (!GUtil.isTrue(name)) {
        name = moduleRevisionId.getName();
    }
    return new DefaultArtifact(
            moduleRevisionId,
            publishArtifact.getDate(),
            name,
            publishArtifact.getType(),
            publishArtifact.getExtension(),
            extraAttributes);
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:18,代码来源:DefaultConfigurationsToArtifactsConverter.java


示例8: download

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public EnhancedArtifactDownloadReport download(Artifact artifact, ArtifactResourceResolver resourceResolver, ResourceDownloader resourceDownloader, CacheDownloadOptions options) {
    ResolvedResource resolvedResource = resourceResolver.resolve(artifact);
    long start = System.currentTimeMillis();
    EnhancedArtifactDownloadReport report = new EnhancedArtifactDownloadReport(artifact);
    if (resolvedResource == null) {
        report.setDownloadStatus(DownloadStatus.FAILED);
        report.setDownloadDetails(ArtifactDownloadReport.MISSING_ARTIFACT);
        report.setDownloadTimeMillis(System.currentTimeMillis() - start);
        return report;
    }
    assert resolvedResource.getResource().isLocal();
    File file = new File(resolvedResource.getResource().getName());
    assert file.isFile();

    ArtifactOrigin origin = new ArtifactOrigin(artifact, true, file.getAbsolutePath());
    report.setDownloadStatus(DownloadStatus.NO);
    report.setArtifactOrigin(origin);
    report.setSize(file.length());
    report.setLocalFile(file);
    return report;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:22,代码来源:LocalFileRepositoryCacheManager.java


示例9: cacheModuleDescriptor

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的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


示例10: resolveArtifact

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public void resolveArtifact(ComponentArtifactMetaData artifact, ModuleSource moduleSource, BuildableArtifactResolveResult result) {
    Artifact ivyArtifact = ((ModuleVersionArtifactMetaData) artifact).toIvyArtifact();
    ArtifactDownloadReport artifactDownloadReport = resolver.download(new Artifact[]{ivyArtifact}, downloadOptions).getArtifactReport(ivyArtifact);
    if (downloadFailed(artifactDownloadReport)) {
        if (artifactDownloadReport instanceof EnhancedArtifactDownloadReport) {
            EnhancedArtifactDownloadReport enhancedReport = (EnhancedArtifactDownloadReport) artifactDownloadReport;
            result.failed(new ArtifactResolveException(artifact.getId(), enhancedReport.getFailure()));
        } else {
            result.failed(new ArtifactResolveException(artifact.getId(), artifactDownloadReport.getDownloadDetails()));
        }
        return;
    }

    File localFile = artifactDownloadReport.getLocalFile();
    if (localFile != null) {
        result.resolved(localFile);
    } else {
        result.notFound(artifact.getId());
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:21,代码来源:IvyDependencyResolverAdapter.java


示例11: doGetCandidateArtifacts

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
private Set<ModuleVersionArtifactMetaData> doGetCandidateArtifacts(ModuleVersionMetaData module, Class<? extends SoftwareArtifact> artifactType) {
    if (artifactType == IvyDescriptorArtifact.class) {
        Artifact metadataArtifact = module.getDescriptor().getMetadataArtifact();
        return ImmutableSet.of(module.artifact(metadataArtifact));
    }

    if (artifactType == JvmLibraryJavadocArtifact.class) {
        return createArtifactMetaData(module, "javadoc", "javadoc");
    }

    if (artifactType == JvmLibrarySourcesArtifact.class) {
        return createArtifactMetaData(module, "source", "sources");
    }

    throw new IllegalArgumentException(String.format("Cannot find artifacts of type %s in %s", artifactType.getName(), module));
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:17,代码来源:IvyDependencyResolverAdapter.java


示例12: publish

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public void publish(IvyNormalizedPublication publication, PublicationAwareRepository repository) {
    ModuleVersionPublisher publisher = repository.createPublisher();
    IvyPublicationIdentity projectIdentity = publication.getProjectIdentity();
    ModuleRevisionId moduleRevisionId = IvyUtil.createModuleRevisionId(projectIdentity.getOrganisation(), projectIdentity.getModule(), projectIdentity.getRevision());
    ModuleVersionIdentifier moduleVersionIdentifier = DefaultModuleVersionIdentifier.newId(moduleRevisionId);
    DefaultModuleVersionPublishMetaData publishMetaData = new DefaultModuleVersionPublishMetaData(moduleVersionIdentifier);

    try {
        for (IvyArtifact publishArtifact : publication.getArtifacts()) {
            Artifact ivyArtifact = createIvyArtifact(publishArtifact, moduleRevisionId);
            publishMetaData.addArtifact(ivyArtifact, publishArtifact.getFile());
        }

        Artifact artifact = DefaultArtifact.newIvyArtifact(moduleRevisionId, null);
        publishMetaData.addArtifact(artifact, publication.getDescriptorFile());

        publisher.publish(publishMetaData);
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:22,代码来源:DependencyResolverIvyPublisher.java


示例13: populateArtifactsFromDescriptor

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
private void populateArtifactsFromDescriptor() {
    Map<Artifact, ModuleComponentArtifactMetaData> artifactToMetaData = Maps.newLinkedHashMap();
    for (Artifact descriptorArtifact : getDescriptor().getAllArtifacts()) {
        IvyArtifactName artifactName = DefaultIvyArtifactName.forIvyArtifact(descriptorArtifact);
        ModuleComponentArtifactMetaData artifact = new DefaultModuleComponentArtifactMetaData(getComponentId(), artifactName);
        artifactToMetaData.put(descriptorArtifact, artifact);
    }

    this.artifactsByConfig = LinkedHashMultimap.create();
    for (String configuration : getDescriptor().getConfigurationsNames()) {
        Artifact[] configArtifacts = getDescriptor().getArtifacts(configuration);
        for (Artifact configArtifact : configArtifacts) {
            artifactsByConfig.put(configuration, artifactToMetaData.get(configArtifact));
        }
    }
}
 
开发者ID:dhakehurst,项目名称:net.akehurst.build.gradle,代码行数:17,代码来源:AbstractModuleComponentResolveMetaData.java


示例14: testPublishWithOverwrite

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
/**
 * Test a simple artifact publish, with overwrite set to true.
 *
 * @throws IOException if something goes wrong
 */
@Test
public void testPublishWithOverwrite() throws IOException {
    // we expect the overwrite settings to be passed through the event listeners and into the
    // publisher.
    this.expectedOverwrite = true;

    // set overwrite to true. InstrumentedResolver will verify that the correct argument value
    // was provided.
    publishOptions.setOverwrite(true);
    Collection<Artifact> missing = publishEngine.publish(publishModule.getModuleRevisionId(),
        publishSources, "default", publishOptions);
    assertEquals("no missing artifacts", 0, missing.size());

    // if all tests passed, all of our counter variables should have been updated.
    assertEquals("pre-publish trigger fired and passed all tests", 2, preTriggers);
    assertEquals("post-publish trigger fired and passed all tests", 2, postTriggers);
    assertEquals("resolver received a publish() call, and passed all tests", 2, publications);
    assertEquals("all expected artifacts have been published", 0, expectedPublications.size());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:25,代码来源:PublishEventsTest.java


示例15: testSimple

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
@Test
public void testSimple() throws Exception {
    ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
        getClass().getResource("test-simple.pom"), false);
    assertNotNull(md);

    ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
    assertEquals(mrid, md.getModuleRevisionId());

    assertNotNull(md.getConfigurations());
    assertEquals(Arrays.asList(PomModuleDescriptorBuilder.MAVEN2_CONFIGURATIONS),
        Arrays.asList(md.getConfigurations()));

    Artifact[] artifact = md.getArtifacts("master");
    assertEquals(1, artifact.length);
    assertEquals(mrid, artifact[0].getModuleRevisionId());
    assertEquals("test", artifact[0].getName());
    assertEquals("jar", artifact[0].getExt());
    assertEquals("jar", artifact[0].getType());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:21,代码来源:PomModuleDescriptorParserTest.java


示例16: download

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
    // Not much to do here - downloads are not required for workspace projects.
    DownloadReport dr = new DownloadReport();
    for (Artifact artifact : artifacts) {
        ArtifactDownloadReport adr = new ArtifactDownloadReport(artifact);
        dr.addArtifactReport(adr);
        URL url = artifact.getUrl();
        if (url == null || !url.getProtocol().equals("file")) {
            // this is not an artifact managed by this resolver
            adr.setDownloadStatus(DownloadStatus.FAILED);
            return dr;
        }
        File f;
        try {
            f = new File(url.toURI());
        } catch (URISyntaxException e) {
            f = new File(url.getPath());
        }
        adr.setLocalFile(f);
        adr.setDownloadStatus(DownloadStatus.NO);
        adr.setSize(0);
        Message.verbose("\t[IN WORKSPACE] " + artifact);
    }
    return dr;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:26,代码来源:AntWorkspaceResolver.java


示例17: testSHA512Checksum

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
/**
 * Tests that <code>SHA-512</code> algorithm can be used for checksums on resolvers
 *
 * @throws Exception if something goes wrong
 */
@Test
public void testSHA512Checksum() throws Exception {
    final FileSystemResolver resolver = new FileSystemResolver();
    resolver.setName("sha256-checksum-resolver");
    resolver.setSettings(settings);

    resolver.addIvyPattern(settings.getBaseDir()
            + "/test/repositories/checksums/[module]/[revision]/[artifact]-[revision].[ext]");
    resolver.addArtifactPattern(settings.getBaseDir()
            + "/test/repositories/checksums/[module]/[revision]/[artifact]-[revision].[ext]");

    resolver.setChecksums("SHA-512");
    final ModuleRevisionId mrid = ModuleRevisionId.newInstance("test", "allright", "3.0");
    final ResolvedModuleRevision rmr = resolver.getDependency(new DefaultDependencyDescriptor(mrid, false), data);
    assertNotNull("Resolved module revision was null for " + mrid, rmr);
    final DownloadReport dr = resolver.download(rmr.getDescriptor().getAllArtifacts(), getDownloadOptions());
    final ArtifactDownloadReport[] successfulDownloadReports = dr.getArtifactsReports(DownloadStatus.SUCCESSFUL);
    assertNotNull("No artifacts were downloaded successfully", successfulDownloadReports);
    assertEquals("Unexpected number of successfully downloaded artifacts", 1, successfulDownloadReports.length);
    final ArtifactDownloadReport successfulDownloadReport = successfulDownloadReports[0];
    final Artifact downloadedArtifact = successfulDownloadReport.getArtifact();
    assertEquals("Unexpected organization of downloaded artifact", "test", downloadedArtifact.getModuleRevisionId().getOrganisation());
    assertEquals("Unexpected module of downloaded artifact", "allright", downloadedArtifact.getModuleRevisionId().getModuleId().getName());
    assertEquals("Unexpected revision of downloaded artifact", "3.0", downloadedArtifact.getModuleRevisionId().getRevision());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:31,代码来源:FileSystemResolverTest.java


示例18: testEjbPackaging

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
@Test
public void testEjbPackaging() throws Exception {
    ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
        getClass().getResource("test-ejb-packaging.pom"), false);
    assertNotNull(md);

    ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
    assertEquals(mrid, md.getModuleRevisionId());

    Artifact[] artifact = md.getArtifacts("master");
    assertEquals(1, artifact.length);
    assertEquals(mrid, artifact[0].getModuleRevisionId());
    assertEquals("test", artifact[0].getName());
    assertEquals("jar", artifact[0].getExt());
    assertEquals("ejb", artifact[0].getType());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:17,代码来源:PomModuleDescriptorParserTest.java


示例19: download

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
@Override
public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
    ensureConfigured();
    clearArtifactAttempts();
    DownloadReport dr = new DownloadReport();
    for (Artifact artifact : artifacts) {
        final ArtifactDownloadReport adr = new ArtifactDownloadReport(artifact);
        dr.addArtifactReport(adr);
        ResolvedResource artifactRef = getArtifactRef(artifact, null);
        if (artifactRef != null) {
            Message.verbose("\t[NOT REQUIRED] " + artifact);
            ArtifactOrigin origin = new ArtifactOrigin(artifact, true, artifactRef
                    .getResource().getName());
            File archiveFile = ((FileResource) artifactRef.getResource()).getFile();
            adr.setDownloadStatus(DownloadStatus.NO);
            adr.setSize(archiveFile.length());
            adr.setArtifactOrigin(origin);
            adr.setLocalFile(archiveFile);
        } else {
            adr.setDownloadStatus(DownloadStatus.FAILED);
        }
    }
    return dr;
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:25,代码来源:CacheResolver.java


示例20: testModel

import org.apache.ivy.core.module.descriptor.Artifact; //导入依赖的package包/类
@Test
public void testModel() throws Exception {
    ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
        getClass().getResource("test-model.pom"), false);
    assertNotNull(md);

    ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
    assertEquals(mrid, md.getModuleRevisionId());

    assertNotNull(md.getConfigurations());
    assertEquals(Arrays.asList(PomModuleDescriptorBuilder.MAVEN2_CONFIGURATIONS),
        Arrays.asList(md.getConfigurations()));

    Artifact[] artifact = md.getArtifacts("master");
    assertEquals(1, artifact.length);
    assertEquals(mrid, artifact[0].getModuleRevisionId());
    assertEquals("test", artifact[0].getName());
    assertEquals("jar", artifact[0].getExt());
    assertEquals("jar", artifact[0].getType());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:21,代码来源:PomModuleDescriptorParserTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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