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


Java ArtifactUtils.copyArtifacts方法代码示例

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


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

示例1: get

import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
public ResolutionGroup get( Artifact artifact, boolean resolveManagedVersions, ArtifactRepository localRepository,
                            List<ArtifactRepository> remoteRepositories )
{
    CacheKey cacheKey = newCacheKey( artifact, resolveManagedVersions, localRepository, remoteRepositories );

    CacheRecord cacheRecord = cache.get( cacheKey );

    if ( cacheRecord != null && !cacheRecord.isStale() )
    {
        Artifact pomArtifact = ArtifactUtils.copyArtifact( cacheRecord.getArtifact() );
        Artifact relocatedArtifact = ArtifactUtils.copyArtifactSafe( cacheRecord.getRelocatedArtifact() );
        Set<Artifact> artifacts =
            ArtifactUtils.copyArtifacts( cacheRecord.getArtifacts(), new LinkedHashSet<Artifact>() );
        Map<String, Artifact> managedVersions = cacheRecord.getManagedVersions();
        if ( managedVersions != null )
        {
            managedVersions = ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<String, Artifact>() );
        }
        return new ResolutionGroup( pomArtifact, relocatedArtifact, artifacts, managedVersions,
                                    cacheRecord.getRemoteRepositories() );
    }

    cache.remove( cacheKey );

    return null;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:27,代码来源:DefaultMavenMetadataCache.java

示例2: CacheRecord

import org.apache.maven.artifact.ArtifactUtils; //导入方法依赖的package包/类
CacheRecord( Artifact pomArtifact, Artifact relocatedArtifact, Set<Artifact> artifacts,
             Map<String, Artifact> managedVersions, List<ArtifactRepository> remoteRepositories )
{
    this.pomArtifact = ArtifactUtils.copyArtifact( pomArtifact );
    this.relocatedArtifact = ArtifactUtils.copyArtifactSafe( relocatedArtifact );
    this.artifacts = ArtifactUtils.copyArtifacts( artifacts, new ArrayList<Artifact>() );
    this.remoteRepositories = new ArrayList<ArtifactRepository>( remoteRepositories );

    this.managedVersions = managedVersions;
    if ( managedVersions != null )
    {
        this.managedVersions =
            ArtifactUtils.copyArtifacts( managedVersions, new LinkedHashMap<String, Artifact>() );
    }

    File pomFile = pomArtifact.getFile();
    if ( pomFile != null && pomFile.canRead() )
    {
        this.length = pomFile.length();
        this.timestamp = pomFile.lastModified();
    }
    else
    {
        this.length = -1;
        this.timestamp = -1;
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:28,代码来源:DefaultMavenMetadataCache.java


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