mirror of
https://github.com/apache/maven.git
synced 2025-03-07 00:59:51 +00:00
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 @@ protected String resolveVersion( Artifact artifact, ArtifactRepository localRepo
|
||||
version = resolveLegacyVersion( artifact, localRepository, remoteRepositories );
|
||||
if ( version == null )
|
||||
{
|
||||
version = artifact.getVersion();
|
||||
version = artifact.getBaseVersion();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,21 +105,14 @@ protected LegacyArtifactMetadata createLegacyMetadata( Artifact artifact )
|
||||
|
||||
protected String constructVersion( Versioning versioning, String baseVersion )
|
||||
{
|
||||
String version = baseVersion;
|
||||
String version = null;
|
||||
Snapshot snapshot = versioning.getSnapshot();
|
||||
if ( snapshot != null )
|
||||
{
|
||||
if ( snapshot.getTimestamp() != null && snapshot.getBuildNumber() > 0 )
|
||||
{
|
||||
String newVersion = snapshot.getTimestamp() + "-" + snapshot.getBuildNumber();
|
||||
if ( version != null )
|
||||
{
|
||||
version = StringUtils.replace( version, "SNAPSHOT", newVersion );
|
||||
}
|
||||
else
|
||||
{
|
||||
version = newVersion;
|
||||
}
|
||||
version = StringUtils.replace( baseVersion, "SNAPSHOT", newVersion );
|
||||
}
|
||||
}
|
||||
return version;
|
||||
|
Loading…
x
Reference in New Issue
Block a user