diff --git a/indexer-core/src/main/java/org/apache/maven/index/DefaultArtifactContextProducer.java b/indexer-core/src/main/java/org/apache/maven/index/DefaultArtifactContextProducer.java index f7b8c3d9..737e51be 100644 --- a/indexer-core/src/main/java/org/apache/maven/index/DefaultArtifactContextProducer.java +++ b/indexer-core/src/main/java/org/apache/maven/index/DefaultArtifactContextProducer.java @@ -145,6 +145,7 @@ protected boolean isIndexable( File file ) return !filename.equals( "maven-metadata.xml" ) && !( filename.startsWith( "maven-metadata-" ) && filename.endsWith( ".xml" ) ) + && !( filename.startsWith( "_" ) && filename.endsWith( ".repositories" ) ) // || filename.endsWith( "-javadoc.jar" ) // || filename.endsWith( "-javadocs.jar" ) // || filename.endsWith( "-sources.jar" ) diff --git a/indexer-core/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java b/indexer-core/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java index 72b1da00..383283f3 100644 --- a/indexer-core/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java +++ b/indexer-core/src/main/java/org/apache/maven/index/artifact/M2GavCalculator.java @@ -92,7 +92,8 @@ else if ( s.endsWith( ".sha1" ) ) } if ( s.endsWith( "maven-metadata.xml" ) - || ( fileName.startsWith( "maven-metadata-" ) && fileName.contains( ".xml" ) ) ) + || ( fileName.startsWith( "maven-metadata-" ) && fileName.contains( ".xml" ) ) + || ( fileName.startsWith( "_" ) && fileName.endsWith( ".repositories" ) ) ) { return null; } diff --git a/indexer-core/src/test/java/org/apache/maven/index/artifact/M2GavCalculatorTest.java b/indexer-core/src/test/java/org/apache/maven/index/artifact/M2GavCalculatorTest.java index a5f62017..3e54d5f1 100644 --- a/indexer-core/src/test/java/org/apache/maven/index/artifact/M2GavCalculatorTest.java +++ b/indexer-core/src/test/java/org/apache/maven/index/artifact/M2GavCalculatorTest.java @@ -585,6 +585,10 @@ public void testGav() assertNull( gav ); gav = gavCalculator.pathToGav( "/dev/mbien/hintmod/maven-metadata-local.xml" ); assertNull( gav ); + gav = gavCalculator.pathToGav( "/dev/mbien/hintmod/1.0-SNAPSHOT/_remote.repositories" ); // causes MINDEXER-164 + assertNull( gav ); + gav = gavCalculator.pathToGav( "/dev/mbien/hintmod/1.0-SNAPSHOT/_maven.repositories" ); + assertNull( gav ); } public void testNegGav()