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


Java Artifact.getModuleRevisionId方法代码示例

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


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

示例1: findArtifactRef

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
@Override
public ResolvedResource findArtifactRef(Artifact artifact, Date date) {
    ensureConfigured(getSettings());
    ModuleRevisionId mrid = artifact.getModuleRevisionId();
    if (isM2compatible()) {
        mrid = convertM2IdForResourceSearch(mrid);
    }
    final String revision = artifact.getId().getRevision();
    final MavenTimedSnapshotVersionMatcher.MavenSnapshotRevision snapshotRevision = MavenTimedSnapshotVersionMatcher.computeIfSnapshot(revision);
    if (snapshotRevision != null) {
        final ResolvedResource rres = findSnapshotArtifact(artifact, date, mrid, snapshotRevision);
        if (rres != null) {
            return rres;
        }
    }
    return findResourceUsingPatterns(mrid, getArtifactPatterns(), artifact,
            getDefaultRMDParser(artifact.getModuleRevisionId().getModuleId()), date);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:19,代码来源:IBiblioResolver.java

示例2: publish

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public void publish(Artifact artifact, File src, boolean overwrite) throws IOException {
    String destPattern;
    if ("ivy".equals(artifact.getType()) && !getIvyPatterns().isEmpty()) {
        destPattern = getIvyPatterns().get(0);
    } else if (!getArtifactPatterns().isEmpty()) {
        destPattern = getArtifactPatterns().get(0);
    } else {
        throw new IllegalStateException("impossible to publish " + artifact + " using " + this
                + ": no artifact pattern defined");
    }
    // Check for m2 compatibility
    ModuleRevisionId mrid = artifact.getModuleRevisionId();
    if (isM2compatible()) {
        mrid = convertM2IdForResourceSearch(mrid);
    }

    String dest = getDestination(destPattern, artifact, mrid);

    put(artifact, src, dest, overwrite);
    Message.info("\tpublished " + artifact.getName() + " to "
            + hidePassword(repository.standardize(dest)));
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:23,代码来源:RepositoryResolver.java

示例3: findArtifactRef

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
@Override
public ResolvedResource findArtifactRef(Artifact artifact, Date date) {
    ModuleRevisionId mrid = artifact.getModuleRevisionId();
    if (isM2compatible()) {
        mrid = convertM2IdForResourceSearch(mrid);
    }
    return findResourceUsingPatterns(mrid, artifactPatterns, artifact,
        getDefaultRMDParser(artifact.getModuleRevisionId().getModuleId()), date);
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:10,代码来源:AbstractPatternsBasedResolver.java

示例4: withExtension

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private static Artifact withExtension(Artifact ar, String ext) {
    return new DefaultArtifact(ar.getModuleRevisionId(), ar.getPublicationDate(), ar.getName(),
            ar.getType(), ext, ar.getUrl(), new HashMap(ar.getExtraAttributes()));
}
 
开发者ID:jerkar,项目名称:jerkar,代码行数:6,代码来源:IvyPublisher.java

示例5: download

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public EnhancedArtifactDownloadReport download(Artifact artifact, ArtifactResourceResolver resourceResolver,
                                               ResourceDownloader resourceDownloader, CacheDownloadOptions options) {
    EnhancedArtifactDownloadReport adr = new EnhancedArtifactDownloadReport(artifact);

    DownloadListener listener = options.getListener();
    if (listener != null) {
        listener.needArtifact(this, artifact);
    }

    long start = System.currentTimeMillis();
    try {
        ResolvedResource artifactRef = resourceResolver.resolve(artifact);
        if (artifactRef != null) {
            final Resource resource = artifactRef.getResource();
            ArtifactOrigin origin = new ArtifactOrigin(artifact, resource.isLocal(), resource.getName());
            if (listener != null) {
                listener.startArtifactDownload(this, artifactRef, artifact, origin);
            }

            ModuleRevisionId moduleRevisionId = artifact.getModuleRevisionId();
            ModuleComponentIdentifier componentIdentifier = DefaultModuleComponentIdentifier.newId(moduleRevisionId.getOrganisation(), moduleRevisionId.getName(), moduleRevisionId.getRevision());
            File artifactFile = downloadAndCacheArtifactFile(new DefaultModuleVersionArtifactMetaData(componentIdentifier, artifact), artifact, resourceDownloader, artifactRef.getResource());

            adr.setDownloadTimeMillis(System.currentTimeMillis() - start);
            adr.setSize(artifactFile.length());
            adr.setDownloadStatus(DownloadStatus.SUCCESSFUL);
            adr.setArtifactOrigin(origin);
            adr.setLocalFile(artifactFile);
        } else {
            adr.setDownloadTimeMillis(System.currentTimeMillis() - start);
            adr.setDownloadStatus(DownloadStatus.FAILED);
            adr.setDownloadDetails(ArtifactDownloadReport.MISSING_ARTIFACT);
        }
    } catch (Throwable throwable) {
        adr.setDownloadTimeMillis(System.currentTimeMillis() - start);
        adr.failed(throwable);
    }
    if (listener != null) {
        listener.endArtifactDownload(this, artifact, adr, adr.getLocalFile());
    }
    return adr;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:43,代码来源:DownloadingRepositoryCacheManager.java

示例6: buildIvyURI

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public static URI buildIvyURI(Artifact artifact) {
    ModuleRevisionId mrid = artifact.getModuleRevisionId();
    return asIvyURI(mrid.getOrganisation(), mrid.getName(), mrid.getBranch(),
        mrid.getRevision(), artifact.getType(), artifact.getName(), artifact.getExt());
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:6,代码来源:BundleInfoAdapter.java

示例7: findArtifactRef

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public synchronized ResolvedResource findArtifactRef(Artifact artifact, Date date) {

        // For our special packager.xml file, defer to superclass
        if (PACKAGER_ARTIFACT_NAME.equals(artifact.getName())
                && PACKAGER_ARTIFACT_TYPE.equals(artifact.getType())
                && PACKAGER_ARTIFACT_EXT.equals(artifact.getExt())) {
            return super.findArtifactRef(artifact, date);
        }

        // Check the cache
        ModuleRevisionId mr = artifact.getModuleRevisionId();
        PackagerCacheEntry entry = packagerCache.get(mr);

        // Ignore invalid entries
        if (entry != null && !entry.isBuilt()) {
            packagerCache.remove(mr);
            entry.cleanup();
            entry = null;
        }

        // Build the artifacts (if not done already)
        if (entry == null) {
            ResolvedResource packager = findArtifactRef(new DefaultArtifact(mr, null,
                    PACKAGER_ARTIFACT_NAME, PACKAGER_ARTIFACT_TYPE, PACKAGER_ARTIFACT_EXT), date);
            if (packager == null) {
                return null;
            }
            entry = new PackagerCacheEntry(mr, this.buildRoot, this.resourceCache,
                    this.resourceURL, this.validate, this.preserve, this.restricted, this.verbose,
                    this.quiet);
            try {
                entry.build(packager.getResource(), properties);
            } catch (IOException e) {
                throw new RuntimeException("can't build artifact " + artifact, e);
            }
            packagerCache.put(mr, entry);
        }

        // Return reference to desired artifact
        return entry.getBuiltArtifact(artifact);
    }
 
开发者ID:apache,项目名称:ant-ivy,代码行数:42,代码来源:PackagerResolver.java

示例8: checkProjectDependencies

import org.apache.ivy.core.module.descriptor.Artifact; //导入方法依赖的package包/类
public boolean checkProjectDependencies() {
    execute();
    try {
        ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
        String[] confs = splitConfs(getConf());
        String resolveId = getResolveId();
        if (resolveId == null) {
            resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
        }
        XmlReportParser parser = new XmlReportParser();
        for (String conf : confs) {
            File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);
            parser.parse(report);

            Artifact[] artifacts = parser.getArtifacts();
            for (Artifact artifact : artifacts) {
                ModuleRevisionId mrid = artifact.getModuleRevisionId();
                if (mrid.getOrganisation().equals(getOrganisationToFind())) {
                    if (mrid.getName().equals(getModuleToFind())) {
                        log(mrid.getOrganisation() + "#" + mrid.getName() + " found in project dependencies !",
                                Project.MSG_DEBUG);
                        // use this version
                        loadCachePath(getOrganisationToFind(), getModuleToFind(), mrid.getRevision(),
                                getConfToFind(), getSettingsReference());
                        return true;
                    } else {
                        // if only organization is found in project
                        // dependencies use the same version with the
                        // required module
                        log("Only organisation : " + mrid.getOrganisation()
                                + " was found in project dependencies !", Project.MSG_DEBUG);
                        loadCachePath(mrid.getOrganisation(), getModuleToFind(), mrid.getRevision(),
                                getConfToFind(), getSettingsReference());
                        return true;

                    }
                }

            }
        }
    } catch (Exception ex) {
        throw new BuildException("impossible to check project dependencies: " + ex, ex);
    }
    return false;
}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:46,代码来源:ProjectDependencyStrategy.java


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