org.apache.maven.artifact.repository.metadata.Versioning.setRelease()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.apache.maven.artifact.repository.metadata.Versioning.setRelease()方法的一些代码示例,展示了Versioning.setRelease()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Versioning.setRelease()方法的具体详情如下:
包路径:org.apache.maven.artifact.repository.metadata.Versioning
类名称:Versioning
方法名:setRelease

Versioning.setRelease介绍

[英]Set what the latest version in the directory is, of the releases only.
[中]设置目录中的最新版本,仅限发布版本。

代码示例

代码示例来源: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

@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<>( recessive.getVersioning().getVersions() );
    versions.addAll( versioning.getVersions() );
    versioning.setVersions( new ArrayList<>( versions ) );
  }
}

代码示例来源: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

versioning.setRelease( interpolatedTrimmed( parser.nextText(), "release" ) );

代码示例来源:origin: apache/maven

v.setRelease( versioning.getRelease() );

代码示例来源:origin: apache/maven

if ( artifact.isRelease() )
  versioning.setRelease( artifact.getBaseVersion() );

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

protected Metadata cleanseMetadataForRepository( boolean snapshot, Metadata metadata )
{
  // remove base versions not belonging here
  List<String> versions = metadata.getVersioning().getVersions();
  for ( Iterator<String> iversion = versions.iterator(); iversion.hasNext(); )
  {
    // if we need snapshots and the version is not snapshot, or
    // if we need releases and the version is snapshot
    if ( ( snapshot && !Gav.isSnapshot( iversion.next() ) )
      || ( !snapshot && Gav.isSnapshot( iversion.next() ) ) )
    {
      iversion.remove();
    }
  }
  metadata.getVersioning().setLatest( getLatestVersion( metadata.getVersioning().getVersions() ) );
  if ( snapshot )
  {
    metadata.getVersioning().setRelease( null );
  }
  else
  {
    metadata.getVersioning().setRelease( metadata.getVersioning().getLatest() );
  }
  return metadata;
}

代码示例来源:origin: org.apache.maven/maven-aether-provider

@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<>( recessive.getVersioning().getVersions() );
    versions.addAll( versioning.getVersions() );
    versioning.setVersions( new ArrayList<>( versions ) );
  }
}

代码示例来源:origin: io.tesla.maven/maven-aether-provider

@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 ) );
  }
}

代码示例来源:origin: org.apache.maven/maven-resolver-provider

@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<>( recessive.getVersioning().getVersions() );
    versions.addAll( versioning.getVersions() );
    versioning.setVersions( new ArrayList<>( versions ) );
  }
}

代码示例来源:origin: org.sonatype.nexus.plugins/nexus-repository-maven

result.getVersioning().setRelease(release);

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

@Override
protected boolean isMetadataCorrect( Metadata oldMd, String path )
  throws IOException
{
  Metadata md = createMetadata( path );
  if ( oldMd.getVersioning().getRelease() == null )
  {
    oldMd.getVersioning().setRelease( "" );
  }
  if ( md.getVersioning().getRelease() == null )
  {
    md.getVersioning().setRelease( "" );
  }
  if ( oldMd.getVersioning().getLatest() == null )
  {
    return false;
  }
  if ( oldMd.getVersioning().getVersions() == null )
  {
    return false;
  }
  if ( oldMd.getArtifactId().equals( md.getArtifactId() ) && oldMd.getGroupId().equals( md.getGroupId() )
    && oldMd.getVersioning().getLatest().equals( md.getVersioning().getLatest() )
    && oldMd.getVersioning().getRelease().equals( md.getVersioning().getRelease() )
    && oldMd.getVersioning().getVersions().equals( md.getVersioning().getVersions() ) )
  {
    return true;
  }
  return false;
}

代码示例来源: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: org.sonatype.nexus/nexus-proxy

vs.setRelease( getReleaseVersion( versions ) );

代码示例来源:origin: io.fabric8/fabric-maven-proxy

mr.getVersioning().setLastUpdated(latestTimestamp(mr.getVersioning().getLastUpdated(), m.getVersioning().getLastUpdated()));
mr.getVersioning().setLatest(latestVersion(mr.getVersioning().getLatest(), m.getVersioning().getLatest()));
mr.getVersioning().setRelease(latestVersion(mr.getVersioning().getRelease(), m.getVersioning().getRelease()));
for (String v : m.getVersioning().getVersions()) {
  if (!mr.getVersioning().getVersions().contains(v)) {

代码示例来源: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: io.tesla.maven/maven-repository-metadata

versioning.setRelease( getTrimmedValue( parser.nextText() ) );

代码示例来源:origin: org.sonatype.nexus/nexus-proxy

metadata.getVersioning().setRelease( null );
String latest = filterMetadata( versions, true );
metadata.getVersioning().setLatest( latest );

代码示例来源:origin: org.sonatype.nexus.plugins/nexus-repository-maven

final Versioning versioning = new Versioning();
versioning.setLatest(maven2Metadata.getBaseVersions().getLatest());
versioning.setRelease(maven2Metadata.getBaseVersions().getRelease());
versioning.setVersions(maven2Metadata.getBaseVersions().getVersions());
versioning.setLastUpdated(Constants.METADATA_DOTLESS_TIMESTAMP.print(maven2Metadata.getLastUpdated()));

相关文章