From f0a666a43d70d00939fef59ff5ebca2e1cd78621 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Sun, 11 Sep 2005 08:14:20 +0000 Subject: [PATCH] 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 --- .../transform/AbstractVersionTransformation.java | 2 +- .../artifact/transform/SnapshotTransformation.java | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java index c3b856f5a4..9b4eeb64de 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/AbstractVersionTransformation.java @@ -130,7 +130,7 @@ public abstract class AbstractVersionTransformation version = resolveLegacyVersion( artifact, localRepository, remoteRepositories ); if ( version == null ) { - version = artifact.getVersion(); + version = artifact.getBaseVersion(); } } diff --git a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java index bdd0b62803..c59a40b9c8 100644 --- a/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java +++ b/maven-artifact-manager/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java @@ -105,21 +105,14 @@ public class SnapshotTransformation 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;