mirror of https://github.com/apache/maven.git
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:
parent
9fa3fc321b
commit
f0a666a43d
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue