本文整理汇总了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;
}
示例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;
}
}