本文整理汇总了Java中org.apache.maven.artifact.repository.metadata.Versioning.updateTimestamp方法的典型用法代码示例。如果您正苦于以下问题:Java Versioning.updateTimestamp方法的具体用法?Java Versioning.updateTimestamp怎么用?Java Versioning.updateTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.artifact.repository.metadata.Versioning
的用法示例。
在下文中一共展示了Versioning.updateTimestamp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: merge
import org.apache.maven.artifact.repository.metadata.Versioning; //导入方法依赖的package包/类
@Override
protected void merge( Metadata recessive )
{
Versioning versioning = metadata.getVersioning();
versioning.updateTimestamp();
if ( recessive.getVersioning() != null )
{
if ( versioning.getLatest() == null )
{
versioning.setLatest( recessive.getVersioning().getLatest() );
}
if ( versioning.getRelease() == null )
{
versioning.setRelease( recessive.getVersioning().getRelease() );
}
Collection<String> versions = new LinkedHashSet<String>( recessive.getVersioning().getVersions() );
versions.addAll( versioning.getVersions() );
versioning.setVersions( new ArrayList<String>( versions ) );
}
}
示例2: executeMojo
import org.apache.maven.artifact.repository.metadata.Versioning; //导入方法依赖的package包/类
@Override
protected void executeMojo() throws MojoExecutionException {
Artifact projectArtifact = project.getArtifact();
Versioning versioning = new Versioning();
versioning.setLatest(projectArtifact.getVersion());
versioning.updateTimestamp();
ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata(projectArtifact, versioning);
projectArtifact.addMetadata(metadata);
GroupRepositoryMetadata groupMetadata = new GroupRepositoryMetadata(project.getGroupId());
groupMetadata.addPluginMapping(getGoalPrefix(), project.getArtifactId(), project.getName());
projectArtifact.addMetadata(groupMetadata);
}
示例3: createMetadata
import org.apache.maven.artifact.repository.metadata.Versioning; //导入方法依赖的package包/类
private ArtifactMetadata createMetadata( Artifact artifact )
{
Versioning versioning = new Versioning();
versioning.updateTimestamp();
versioning.addVersion( artifact.getVersion() );
if ( artifact.isRelease() )
{
versioning.setRelease( artifact.getVersion() );
}
return new ArtifactRepositoryMetadata( artifact, versioning );
}
示例4: install
import org.apache.maven.artifact.repository.metadata.Versioning; //导入方法依赖的package包/类
public void install( File source, Artifact artifact, ArtifactRepository localRepository )
throws ArtifactInstallationException
{
RepositorySystemSession session =
LegacyLocalRepositoryManager.overlay( localRepository, legacySupport.getRepositorySession(), repoSystem );
InstallRequest request = new InstallRequest();
request.setTrace( DefaultRequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) );
org.sonatype.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact );
mainArtifact = mainArtifact.setFile( source );
request.addArtifact( mainArtifact );
for ( ArtifactMetadata metadata : artifact.getMetadataList() )
{
if ( metadata instanceof ProjectArtifactMetadata )
{
org.sonatype.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() );
request.addArtifact( pomArtifact );
}
else if ( metadata instanceof SnapshotArtifactRepositoryMetadata
|| metadata instanceof ArtifactRepositoryMetadata )
{
// eaten, handled by repo system
}
else
{
request.addMetadata( new MetadataBridge( metadata ) );
}
}
try
{
repoSystem.install( session, request );
}
catch ( InstallationException e )
{
throw new ArtifactInstallationException( e.getMessage(), e );
}
/*
* NOTE: Not used by Maven core, only here to provide backward-compat with plugins like the Install Plugin.
*/
if ( artifact.isSnapshot() )
{
Snapshot snapshot = new Snapshot();
snapshot.setLocalCopy( true );
artifact.addMetadata( new SnapshotArtifactRepositoryMetadata( artifact, snapshot ) );
}
Versioning versioning = new Versioning();
versioning.updateTimestamp();
versioning.addVersion( artifact.getBaseVersion() );
if ( artifact.isRelease() )
{
versioning.setRelease( artifact.getBaseVersion() );
}
artifact.addMetadata( new ArtifactRepositoryMetadata( artifact, versioning ) );
}