private String filterMetadata( List<String> versions, boolean allowSnapshot ) { String latest = null; for ( Iterator<String> it = versions.iterator(); it.hasNext(); ) { String version = it.next(); if ( allowSnapshot ^ Gav.isSnapshot( version ) ) { it.remove(); } else { latest = version; } } return latest; }
protected boolean versionMatchesPolicy( String version, RepositoryPolicy policy ) { boolean result = false; if ( ( RepositoryPolicy.SNAPSHOT.equals( policy ) && Gav.isSnapshot( version ) ) || ( RepositoryPolicy.RELEASE.equals( policy ) && !Gav.isSnapshot( version ) ) ) { result = true; } return result; }
protected boolean versionMatchesPolicy(String version, RepositoryPolicy policy) { boolean result = false; if ((RepositoryPolicy.SNAPSHOT.equals(policy) && Gav.isSnapshot(version)) || (RepositoryPolicy.RELEASE.equals(policy) && !Gav.isSnapshot(version))) { result = true; } return result; }
this.artifactId = artifactId; this.version = version; this.snapshot = isSnapshot( version );
@VisibleForTesting boolean doesImpactMavenMetadata( final Gav requestGav ) { // hashes and signatures are "meta" // released artifacts with classifiers do not change metadata return !( requestGav.isHash() || requestGav.isSignature() || ( StringUtils.isNotBlank( requestGav.getClassifier() ) && !requestGav.isSnapshot() ) ); }
protected boolean pathIsValidSnapshotGav( MavenRepository repository, String path ) { final Gav gav = repository.getGavCalculator().pathToGav( path ); return gav != null && gav.isSnapshot() && !gav.isHash() && !gav.isSignature(); } }
if ( Gav.isSnapshot( gav.getVersion() ) )
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; }
if ( !Gav.isSnapshot( versions.get( i ) ) ) if ( Gav.isSnapshot( versions.get( i ) ) )
if ( !Gav.isSnapshot( versions.get( i ) ) )
if ( !StringUtils.isEmpty( latest ) && Gav.isSnapshot( latest ) )
if ( gav.isSnapshot() && ( !gav.getVersion().equals( gav.getBaseVersion() ) ) )
if ( gav.isSnapshot() && gav.getVersion().equals( gav.getBaseVersion() ) )
if ( gav.isSnapshot() )
if ( gav.isSnapshot() )
resource.setSnapshot(resolvedGav.isSnapshot());
if ( gav.isSnapshot() )
if ( gav.isSnapshot() )
resource.setSnapshot( resolvedGav.isSnapshot() );