don't assign base version to early, or legacy metadata is not checked

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280094 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-11 08:14:20 +00:00
parent 9fa3fc321b
commit f0a666a43d
2 changed files with 3 additions and 10 deletions

View File

@ -130,7 +130,7 @@ public abstract class AbstractVersionTransformation
version = resolveLegacyVersion( artifact, localRepository, remoteRepositories ); version = resolveLegacyVersion( artifact, localRepository, remoteRepositories );
if ( version == null ) if ( version == null )
{ {
version = artifact.getVersion(); version = artifact.getBaseVersion();
} }
} }

View File

@ -105,21 +105,14 @@ public class SnapshotTransformation
protected String constructVersion( Versioning versioning, String baseVersion ) protected String constructVersion( Versioning versioning, String baseVersion )
{ {
String version = baseVersion; String version = null;
Snapshot snapshot = versioning.getSnapshot(); Snapshot snapshot = versioning.getSnapshot();
if ( snapshot != null ) if ( snapshot != null )
{ {
if ( snapshot.getTimestamp() != null && snapshot.getBuildNumber() > 0 ) if ( snapshot.getTimestamp() != null && snapshot.getBuildNumber() > 0 )
{ {
String newVersion = snapshot.getTimestamp() + "-" + snapshot.getBuildNumber(); String newVersion = snapshot.getTimestamp() + "-" + snapshot.getBuildNumber();
if ( version != null ) version = StringUtils.replace( baseVersion, "SNAPSHOT", newVersion );
{
version = StringUtils.replace( version, "SNAPSHOT", newVersion );
}
else
{
version = newVersion;
}
} }
} }
return version; return version;