mirror of https://github.com/apache/archiva.git
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:
parent
1c018926a6
commit
fd582b1d54
|
@ -27,10 +27,10 @@ import org.apache.maven.artifact.repository.metadata.Versioning;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class indexes the metadata in the repository.
|
* This class indexes the metadata in the repository.
|
||||||
|
@ -76,7 +76,7 @@ public class MetadataRepositoryIndex
|
||||||
{
|
{
|
||||||
deleteDocuments( getTermList( metadataList ) );
|
deleteDocuments( getTermList( metadataList ) );
|
||||||
}
|
}
|
||||||
catch( IOException e )
|
catch ( IOException e )
|
||||||
{
|
{
|
||||||
throw new RepositoryIndexException( "Failed to delete an index document", e );
|
throw new RepositoryIndexException( "Failed to delete an index document", e );
|
||||||
}
|
}
|
||||||
|
@ -163,9 +163,17 @@ public class MetadataRepositoryIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doc.add( Field.Text( FLD_PLUGINPREFIX, pluginAppended ) );
|
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() ) );
|
doc.add( Field.Text( FLD_ARTIFACTID, metadata.getArtifactId() ) );
|
||||||
}
|
}
|
||||||
|
@ -174,7 +182,7 @@ public class MetadataRepositoryIndex
|
||||||
doc.add( Field.Text( FLD_ARTIFACTID, "" ) );
|
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() ) );
|
doc.add( Field.Text( FLD_VERSION, metadata.getVersion() ) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue