From ff02698e3a5f361ba8ee860e1a225d22f96ab8d1 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sun, 22 Apr 2007 18:00:06 +0000 Subject: [PATCH] o missed a commit when fixing stuff on the branch git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@531241 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/artifact/ArtifactUtils.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java b/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java index 3323b4ad8c..16b0d670a6 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java @@ -109,6 +109,27 @@ public final class ArtifactUtils public static Artifact copyArtifact( Artifact artifact ) { VersionRange range = artifact.getVersionRange(); + + // For some reason with the introduction of MNG-1577 we have the case in Yoko where a depMan section has + // something like the following: + // + // + // + // + // + // org.apache.yoko + // yoko-core + // ${version} + // + // ... + // + // And the range is not set so we'll check here and set it. jvz. + + if ( range == null ) + { + range = VersionRange.createFromVersion( artifact.getVersion() ); + } + DefaultArtifact clone = new DefaultArtifact( artifact.getGroupId(), artifact.getArtifactId(), range.cloneOf(), artifact.getScope(), artifact.getType(), artifact.getClassifier(), artifact.getArtifactHandler(), artifact.isOptional() );