diff options
author | Brett Porter <brett@apache.org> | 2006-07-22 15:10:51 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2006-07-22 15:10:51 +0000 |
commit | fd582b1d54e729d002920387dbe5926c2e07335a (patch) | |
tree | ec8897d47fbebf71441b8f2b0fe8d1ecf387d6f7 /maven-repository-indexer | |
parent | 1c018926a66b4569511dcf9df8edfde7b4295def (diff) | |
download | archiva-fd582b1d54e729d002920387dbe5926c2e07335a.tar.gz archiva-fd582b1d54e729d002920387dbe5926c2e07335a.zip |
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
Diffstat (limited to 'maven-repository-indexer')
-rw-r--r-- | maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java b/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java index 56b754188..e2590bc2e 100644 --- a/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java +++ b/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java @@ -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.
@@ -76,7 +76,7 @@ public class MetadataRepositoryIndex {
deleteDocuments( getTermList( metadataList ) );
}
- catch( IOException e )
+ catch ( IOException 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_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() ) );
}
|