fix issue with missing group ids in metadata

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@424592 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2006-07-22 15:10:51 +00:00
parent 1c018926a6
commit fd582b1d54
1 changed files with 14 additions and 6 deletions

View File

@ -27,10 +27,10 @@ import org.apache.maven.artifact.repository.metadata.Versioning;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.ArrayList;
/**
* This class indexes the metadata in the repository.
@ -163,9 +163,17 @@ public class MetadataRepositoryIndex
}
}
doc.add( Field.Text( FLD_PLUGINPREFIX, pluginAppended ) );
doc.add( Field.Text( FLD_GROUPID, metadata.getGroupId() ) );
if ( metadata.getArtifactId() != null && !"".equals( metadata.getArtifactId() ) )
if ( metadata.getGroupId() != null )
{
doc.add( Field.Text( FLD_GROUPID, metadata.getGroupId() ) );
}
else
{
doc.add( Field.Text( FLD_GROUPID, "" ) );
}
if ( metadata.getArtifactId() != null )
{
doc.add( Field.Text( FLD_ARTIFACTID, metadata.getArtifactId() ) );
}
@ -174,7 +182,7 @@ public class MetadataRepositoryIndex
doc.add( Field.Text( FLD_ARTIFACTID, "" ) );
}
if ( metadata.getVersion() != null && !"".equals( metadata.getVersion() ) )
if ( metadata.getVersion() != null )
{
doc.add( Field.Text( FLD_VERSION, metadata.getVersion() ) );
}