本文整理了Java中org.apache.maven.artifact.repository.metadata.Versioning.<init>()
方法的一些代码示例,展示了Versioning.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Versioning.<init>()
方法的具体详情如下:
包路径:org.apache.maven.artifact.repository.metadata.Versioning
类名称:Versioning
方法名:<init>
暂无
代码示例来源:origin: apache/maven
protected static Versioning createVersioning( Snapshot snapshot )
{
Versioning versioning = new Versioning();
versioning.setSnapshot( snapshot );
versioning.updateTimestamp();
return versioning;
}
代码示例来源:origin: apache/maven
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 );
}
代码示例来源:origin: apache/maven
private Versioning readVersions( RepositorySystemSession session, RequestTrace trace, Metadata metadata,
ArtifactRepository repository, VersionRangeResult result )
{
Versioning versioning = null;
try
{
if ( metadata != null )
{
try ( SyncContext syncContext = syncContextFactory.newInstance( session, true ) )
{
syncContext.acquire( null, Collections.singleton( metadata ) );
if ( metadata.getFile() != null && metadata.getFile().exists() )
{
try ( final InputStream in = new FileInputStream( metadata.getFile() ) )
{
versioning = new MetadataXpp3Reader().read( in, false ).getVersioning();
}
}
}
}
}
catch ( Exception e )
{
invalidMetadata( session, trace, metadata, repository, e );
result.addException( e );
}
return ( versioning != null ) ? versioning : new Versioning();
}
代码示例来源:origin: apache/maven
snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );
Versioning versioning = new Versioning();
versioning.setSnapshot( snapshot );
versioning.setLastUpdated( snapshot.getTimestamp().replace( ".", "" ) );
代码示例来源:origin: apache/maven
&& versioning.getSnapshot().getBuildNumber() > 0 )
final Versioning repaired = new Versioning();
repaired.setLastUpdated( versioning.getLastUpdated() );
repaired.setSnapshot( new Snapshot() );
return ( versioning != null ) ? versioning : new Versioning();
代码示例来源:origin: apache/maven
private static Metadata createRepositoryMetadata( Artifact artifact )
{
Metadata metadata = new Metadata();
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
Versioning versioning = new Versioning();
versioning.addVersion( artifact.getBaseVersion() );
if ( !artifact.isSnapshot() )
{
versioning.setRelease( artifact.getBaseVersion() );
}
if ( "maven-plugin".equals( artifact.getProperty( ArtifactProperties.TYPE, "" ) ) )
{
versioning.setLatest( artifact.getBaseVersion() );
}
metadata.setVersioning( versioning );
return metadata;
}
代码示例来源:origin: apache/maven
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat )
{
Snapshot snapshot = new Snapshot();
snapshot.setLocalCopy( true );
Versioning versioning = new Versioning();
versioning.setSnapshot( snapshot );
Metadata metadata = new Metadata();
metadata.setVersioning( versioning );
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
metadata.setVersion( artifact.getBaseVersion() );
if ( !legacyFormat )
{
metadata.setModelVersion( "1.1.0" );
}
return metadata;
}
代码示例来源:origin: apache/maven
m.setVersioning( new Versioning() );
代码示例来源:origin: apache/maven
Versioning versioning = new Versioning();
for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
代码示例来源:origin: apache/maven
if ( v == null )
v = new Versioning();
setVersioning( v );
changed = true;
代码示例来源:origin: apache/maven
Versioning versioning = new Versioning();
versioning.updateTimestamp();
versioning.addVersion( artifact.getBaseVersion() );
代码示例来源:origin: takari/takari-lifecycle
@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);
}
代码示例来源:origin: io.takari.maven.plugins/takari-lifecycle-plugin
@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);
}
代码示例来源:origin: org.apache.maven.plugins/maven-plugin-plugin
/** {@inheritDoc} */
public void execute()
throws MojoExecutionException
{
if ( skip )
{
getLog().warn( "Execution skipped" );
return;
}
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 );
}
代码示例来源:origin: org.apache.maven/maven-aether-provider
private static Metadata createRepositoryMetadata( Artifact artifact )
{
Metadata metadata = new Metadata();
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
Versioning versioning = new Versioning();
versioning.addVersion( artifact.getBaseVersion() );
if ( !artifact.isSnapshot() )
{
versioning.setRelease( artifact.getBaseVersion() );
}
if ( "maven-plugin".equals( artifact.getProperty( ArtifactProperties.TYPE, "" ) ) )
{
versioning.setLatest( artifact.getBaseVersion() );
}
metadata.setVersioning( versioning );
return metadata;
}
代码示例来源:origin: io.tesla.maven/maven-aether-provider
private static Metadata createRepositoryMetadata( Artifact artifact )
{
Metadata metadata = new Metadata();
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
Versioning versioning = new Versioning();
versioning.addVersion( artifact.getBaseVersion() );
if ( !artifact.isSnapshot() )
{
versioning.setRelease( artifact.getBaseVersion() );
}
if ( "maven-plugin".equals( artifact.getProperty( ArtifactProperties.TYPE, "" ) ) )
{
versioning.setLatest( artifact.getBaseVersion() );
}
metadata.setVersioning( versioning );
return metadata;
}
代码示例来源:origin: org.apache.maven/maven-resolver-provider
private static Metadata createRepositoryMetadata( Artifact artifact )
{
Metadata metadata = new Metadata();
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
Versioning versioning = new Versioning();
versioning.addVersion( artifact.getBaseVersion() );
if ( !artifact.isSnapshot() )
{
versioning.setRelease( artifact.getBaseVersion() );
}
if ( "maven-plugin".equals( artifact.getProperty( ArtifactProperties.TYPE, "" ) ) )
{
versioning.setLatest( artifact.getBaseVersion() );
}
metadata.setVersioning( versioning );
return metadata;
}
代码示例来源:origin: org.apache.maven/maven-aether-provider
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat )
{
Snapshot snapshot = new Snapshot();
snapshot.setLocalCopy( true );
Versioning versioning = new Versioning();
versioning.setSnapshot( snapshot );
Metadata metadata = new Metadata();
metadata.setVersioning( versioning );
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
metadata.setVersion( artifact.getBaseVersion() );
if ( !legacyFormat )
{
metadata.setModelVersion( "1.1.0" );
}
return metadata;
}
代码示例来源:origin: org.apache.maven/maven-resolver-provider
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat )
{
Snapshot snapshot = new Snapshot();
snapshot.setLocalCopy( true );
Versioning versioning = new Versioning();
versioning.setSnapshot( snapshot );
Metadata metadata = new Metadata();
metadata.setVersioning( versioning );
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
metadata.setVersion( artifact.getBaseVersion() );
if ( !legacyFormat )
{
metadata.setModelVersion( "1.1.0" );
}
return metadata;
}
代码示例来源:origin: io.tesla.maven/maven-aether-provider
private static Metadata createMetadata( Artifact artifact, boolean legacyFormat )
{
Snapshot snapshot = new Snapshot();
snapshot.setLocalCopy( true );
Versioning versioning = new Versioning();
versioning.setSnapshot( snapshot );
Metadata metadata = new Metadata();
metadata.setVersioning( versioning );
metadata.setGroupId( artifact.getGroupId() );
metadata.setArtifactId( artifact.getArtifactId() );
metadata.setVersion( artifact.getBaseVersion() );
if ( !legacyFormat )
{
metadata.setModelVersion( "1.1.0" );
}
return metadata;
}
内容来源于网络,如有侵权,请联系作者删除!