snapshot = new Snapshot();
snapshot.setBuildNumber( getBuildNumber( recessive ) + 1 );
snapshot.setTimestamp( utcDateFormatter.format( new Date() ) );
Versioning versioning = new Versioning();
versioning.setSnapshot( snapshot );
versioning.setLastUpdated( snapshot.getTimestamp().replace( ".", "" ) );
lastUpdated = versioning.getLastUpdated();
metadata.setVersioning( versioning );
}
else
{
snapshot = metadata.getVersioning().getSnapshot();
lastUpdated = metadata.getVersioning().getLastUpdated();
}
for ( Artifact artifact : artifacts )
{
String version = artifact.getVersion();
if ( version.endsWith( SNAPSHOT ) )
{
String qualifier = snapshot.getTimestamp() + "-" + snapshot.getBuildNumber();
version = version.substring( 0, version.length() - SNAPSHOT.length() ) + qualifier;
}
SnapshotVersion sv = new SnapshotVersion();
sv.setClassifier( artifact.getClassifier() );
sv.setVersion( version );
sv.setUpdated( lastUpdated );
versions.put( sv.getClassifier(), sv );
}
artifacts.clear();
Versioning versioning = recessive.getVersioning();
if ( versioning != null )
{
for ( SnapshotVersion sv : versioning.getSnapshotVersions() )
{
if ( !versions.containsKey( sv.getClassifier() ) )
{
versions.put( sv.getClassifier(), sv );
}