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
This commit is contained in:
Jason van Zyl 2007-04-22 18:00:06 +00:00
parent 93c8d30067
commit ff02698e3a
1 changed files with 21 additions and 0 deletions

View File

@ -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:
//
// <dependencyManagement>
// <dependencies>
// <!-- Yoko modules -->
// <dependency>
// <groupId>org.apache.yoko</groupId>
// <artifactId>yoko-core</artifactId>
// <version>${version}</version>
// </dependency>
// ...
//
// 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() );