Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
NEXUS-50: fix
Browse files Browse the repository at this point in the history
git-svn-id: file:///opt/svn/repositories/sonatype.org/nexus/trunk/nexus-indexer@381 2aa8b3fc-8ebb-4439-a84f-95066eaea8ab
  • Loading branch information
cstamas committed Jun 12, 2008
1 parent 8605cb1 commit 7de5b05
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/org/sonatype/nexus/index/ArtifactInfo.java
Expand Up @@ -17,6 +17,9 @@
import java.util.Comparator;
import java.util.List;

import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;

/**
* ArtifactInfo holds the values known about an repository artifact. This is a simple Value Object kind of stuff.
*
Expand Down Expand Up @@ -103,6 +106,8 @@ public class ArtifactInfo

public String version;

private ArtifactVersion artifactVersion;

public String classifier;

public String packaging;
Expand Down Expand Up @@ -183,6 +188,15 @@ public ArtifactInfo( String repository, String groupId, String artifactId, Strin
this.classifier = classifier;
}

public ArtifactVersion getArtifactVersion()
{
if ( artifactVersion == null )
{
artifactVersion = new DefaultArtifactVersion( version );
}
return artifactVersion;
}

@Override
public String toString()
{
Expand Down Expand Up @@ -212,7 +226,7 @@ public int compare( ArtifactInfo f1, ArtifactInfo f2 )
return n;
}

n = -f1.version.compareTo( f2.version );
n = -f1.getArtifactVersion().compareTo( f2.getArtifactVersion() );
if ( n != 0 )
{
return n;
Expand Down

0 comments on commit 7de5b05

Please sign in to comment.