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

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

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

Versioning.getSnapshotVersions介绍

[英]Method getSnapshotVersions.
[中]方法getSnapshotVersions。

代码示例

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

/**
 * Method removeSnapshotVersion.
 * 
 * @param snapshotVersion
 */
public void removeSnapshotVersion( SnapshotVersion snapshotVersion )
{
  getSnapshotVersions().remove( snapshotVersion );
} //-- void removeSnapshotVersion( SnapshotVersion )

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

/**
 * Method addSnapshotVersion.
 * 
 * @param snapshotVersion
 */
public void addSnapshotVersion( SnapshotVersion snapshotVersion )
{
  getSnapshotVersions().add( snapshotVersion );
} //-- void addSnapshotVersion( SnapshotVersion )

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

for ( SnapshotVersion sv : versioning.getSnapshotVersions() )
if ( snapshot != null && versioning.getSnapshotVersions().isEmpty() )

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

if ( versioning != null )
  for ( SnapshotVersion sv : versioning.getSnapshotVersions() )

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

if ( versioning != null )
  for ( SnapshotVersion sv : versioning.getSnapshotVersions() )

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

if ( ( versioning.getSnapshotVersions() != null ) && ( versioning.getSnapshotVersions().size() > 0 ) )
  for ( Iterator iter = versioning.getSnapshotVersions().iterator(); iter.hasNext(); )

代码示例来源:origin: io.tesla.maven/maven-repository-metadata

/**
 * Method addSnapshotVersion.
 * 
 * @param snapshotVersion
 */
public void addSnapshotVersion( SnapshotVersion snapshotVersion )
{
  getSnapshotVersions().add( snapshotVersion );
} //-- void addSnapshotVersion( SnapshotVersion )

代码示例来源:origin: io.tesla.maven/maven-repository-metadata

/**
 * Method removeSnapshotVersion.
 * 
 * @param snapshotVersion
 */
public void removeSnapshotVersion( SnapshotVersion snapshotVersion )
{
  getSnapshotVersions().remove( snapshotVersion );
} //-- void removeSnapshotVersion( SnapshotVersion )

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

private boolean versioningEquals(@Nullable final Versioning v1,
                 @Nullable final Versioning v2) { // NOSONAR
 if (v1 == null || v2 == null) {
  return v1 == v2; // NOSONAR
 }
 else {
  return
   Objects.equals(v1.getLatest(), v2.getLatest()) && // NOSONAR
   Objects.equals(v1.getRelease(), v2.getRelease()) &&
   snapshotEquals(v1.getSnapshot(), v2.getSnapshot()) &&
   Objects.equals(v1.getVersions(), v2.getVersions()) &&
   snapshotVersionsEquals(v1.getSnapshotVersions(), v2.getSnapshotVersions());
 }
}

代码示例来源:origin: org.sonatype.nexus/nexus-test-harness-launcher

public static void assertEquals(Metadata m1, Metadata m2) {
 assertThat(m1, is(notNullValue()));
 assertThat(m2, is(notNullValue()));
 assertThat(m1.getArtifactId(), equalTo(m2.getArtifactId()));
 assertThat(m1.getGroupId(), equalTo(m2.getGroupId()));
 assertThat(m1.getVersion(), equalTo(m2.getVersion()));
 assertThat(m1.getVersioning(), is(notNullValue()));
 assertThat(m2.getVersioning(), is(notNullValue()));
 assertThat(m1.getVersioning().getLatest(), equalTo(m2.getVersioning().getLatest()));
 assertThat(m1.getVersioning().getRelease(), equalTo(m2.getVersioning().getRelease()));
 if (m1.getVersioning().getSnapshot() != null || m1.getVersioning().getSnapshot() != null) {
  assertThat(m1.getVersioning().getSnapshot().getBuildNumber(),
    equalTo(m2.getVersioning().getSnapshot().getBuildNumber()));
  assertThat(m1.getVersioning().getSnapshot().getTimestamp(),
    equalTo(m2.getVersioning().getSnapshot().getTimestamp()));
 }
 assertThat(m1.getVersioning().getSnapshotVersions().size(), equalTo(
   m2.getVersioning().getSnapshotVersions().size()));
 for (int i = 0; i < m1.getVersioning().getSnapshotVersions().size(); i++) {
  SnapshotVersion s1 = m1.getVersioning().getSnapshotVersions().get(i);
  SnapshotVersion s2 = get(s1, m2.getVersioning().getSnapshotVersions());
  assertThat(s1, is(notNullValue()));
  assertThat(s2, is(notNullValue()));
  assertThat(s1.getClassifier(), equalTo(s2.getClassifier()));
  assertThat(s1.getExtension(), equalTo(s2.getExtension()));
  assertThat(s1.getUpdated(), equalTo(s2.getUpdated()));
  assertThat(s1.getVersion(), equalTo(s2.getVersion()));
 }
}

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

assertThat( m1.getVersioning().getSnapshotVersions().size(), equalTo(
  m2.getVersioning().getSnapshotVersions().size() ) );
for ( int i = 0; i < m1.getVersioning().getSnapshotVersions().size(); i++ )
  SnapshotVersion s1 = m1.getVersioning().getSnapshotVersions().get( i );
  SnapshotVersion s2 = get( s1, m2.getVersioning().getSnapshotVersions() );

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

for ( SnapshotVersion sv : versioning.getSnapshotVersions() )
if ( snapshot != null && versioning.getSnapshotVersions().isEmpty() )

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

for ( SnapshotVersion sv : versioning.getSnapshotVersions() )
if ( snapshot != null && versioning.getSnapshotVersions().isEmpty() )

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

for ( SnapshotVersion sv : versioning.getSnapshotVersions() )
if ( snapshot != null && versioning.getSnapshotVersions().isEmpty() )

代码示例来源:origin: com.atlassian.sdk/ap3-aether-maven-provider

for ( SnapshotVersion sv : versioning.getSnapshotVersions() )
if ( snapshot != null && versioning.getSnapshotVersions().isEmpty() )

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

if ( versioning != null )
  for ( SnapshotVersion sv : versioning.getSnapshotVersions() )

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

if ( versioning != null )
  for ( SnapshotVersion sv : versioning.getSnapshotVersions() )

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

if ( versioning != null )
  for ( SnapshotVersion sv : versioning.getSnapshotVersions() )

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

@Override
protected boolean isMetadataCorrect( Metadata oldMd, String path )
  throws IOException
{
  if ( oldMd.getArtifactId() == null || oldMd.getGroupId() == null || oldMd.getVersion() == null
    || oldMd.getVersioning() == null || oldMd.getVersioning().getSnapshot() == null
    || oldMd.getVersioning().getSnapshot().getTimestamp() == null )
  {
    return false;
  }
  Metadata md = createMetadata( path );
  if ( StringUtils.equals( oldMd.getArtifactId(), md.getArtifactId() )
    && StringUtils.equals( oldMd.getGroupId(), md.getGroupId() )
    && StringUtils.equals( oldMd.getVersion(), md.getVersion() )
    && md.getVersioning() != null
    && md.getVersioning().getSnapshot() != null
    && StringUtils.equals( oldMd.getVersioning().getSnapshot().getTimestamp(),
      md.getVersioning().getSnapshot().getTimestamp() )
    && oldMd.getVersioning().getSnapshot().getBuildNumber() == md.getVersioning().getSnapshot().getBuildNumber()
    && ( oldMd.getVersioning().getVersions().containsAll( md.getVersioning().getVersions() ) && md.getVersioning().getVersions().containsAll(
      oldMd.getVersioning().getVersions() ) )
    && equals( oldMd.getVersioning().getSnapshotVersions(), md.getVersioning().getSnapshotVersions() ) )
  {
    return true;
  }
  return false;
}

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

protected Gav resolveSnapshotFromM3Metadata( final ArtifactStoreRequest gavRequest, final Gav gav, final Metadata gavMd )
  throws IOException
{
  for ( SnapshotVersion sv : gavMd.getVersioning().getSnapshotVersions() )
  {
    if ( StringUtils.equals( sv.getExtension(), gav.getExtension() )
      && StringUtils.equals( StringUtils.defaultString( sv.getClassifier(), "" ),
        StringUtils.defaultString( gav.getClassifier(), "" ) ) )
    {
      Long buildTs = getTimeFromMetadataTimestampMaven3Updated( sv.getUpdated() );
      Integer buildNo = getBuildNumberForMetadataMaven3Value( sv.getVersion() );
      return new Gav( gav.getGroupId(), gav.getArtifactId(), sv.getVersion(), gav.getClassifier(),
        gav.getExtension(), buildNo, buildTs, gav.getName(), gav.isHash(), gav.getHashType(),
        gav.isSignature(), gav.getSignatureType() );
    }
  }
  // even if model version is 1.1.0, we have no snapshots versions?
  return resolveSnapshotFromM2Metadata( gavRequest, gav, gavMd );
}

相关文章