aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorMaria Odea B. Ching <oching@apache.org>2008-07-10 09:02:07 +0000
committerMaria Odea B. Ching <oching@apache.org>2008-07-10 09:02:07 +0000
commit0a94a40f00c7eddcb36e8ca1bb153f001ea50abb (patch)
tree0a9bd0338c8e9fb3170c9a3d9b304fb4662a5dc3 /archiva-modules
parent59313f36c3d3c4fc52b6f2b89a776a3c3b6b2c7a (diff)
downloadarchiva-0a94a40f00c7eddcb36e8ca1bb153f001ea50abb.tar.gz
archiva-0a94a40f00c7eddcb36e8ca1bb153f001ea50abb.zip
[MRM-737]
-do not index metadata files git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@675483 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java
index 26d0cca6c..77fab6ea4 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java
@@ -36,10 +36,13 @@ import org.apache.maven.archiva.repository.ManagedRepositoryContent;
import org.apache.maven.archiva.repository.RepositoryContentFactory;
import org.apache.maven.archiva.repository.RepositoryException;
import org.apache.maven.archiva.repository.layout.LayoutException;
+import org.apache.maven.archiva.repository.metadata.MetadataTools;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
import org.codehaus.plexus.registry.Registry;
import org.codehaus.plexus.registry.RegistryListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
@@ -60,6 +63,8 @@ public class IndexContentConsumer
extends AbstractMonitoredConsumer
implements KnownRepositoryContentConsumer, RegistryListener, Initializable
{
+ private Logger log = LoggerFactory.getLogger( IndexContentConsumer.class );
+
private static final String READ_CONTENT = "read_content";
private static final String INDEX_ERROR = "indexing_error";
@@ -147,6 +152,12 @@ public class IndexContentConsumer
public void processFile( String path )
throws ConsumerException
{
+ if ( path.endsWith( "/" + MetadataTools.MAVEN_METADATA ) )
+ {
+ log.debug( "File is a metadata file. Not indexing." );
+ return;
+ }
+
FileContentRecord record = new FileContentRecord();
try
{