aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-discoverer/src
diff options
context:
space:
mode:
authorHenri Yandell <bayard@apache.org>2006-11-16 22:54:32 +0000
committerHenri Yandell <bayard@apache.org>2006-11-16 22:54:32 +0000
commita45320f77c38d583565811c191703662e25d1531 (patch)
tree5331470fb08345d1e49a12db90ebb3b8cd2cdca5 /archiva-discoverer/src
parent371ebf103ad69251f6d224e5998e30ef81c42dc0 (diff)
downloadarchiva-a45320f77c38d583565811c191703662e25d1531.tar.gz
archiva-a45320f77c38d583565811c191703662e25d1531.zip
Applying Tom Huybrechts patch rom MRM-226. Stops the indexer blo
wing up when it hits it and thinks its a -sources for a foo-test artifact git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@475959 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-discoverer/src')
-rw-r--r--archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscoverer.java7
-rw-r--r--archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java10
-rw-r--r--archiva-discoverer/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar0
3 files changed, 17 insertions, 0 deletions
diff --git a/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscoverer.java b/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscoverer.java
index f72f82eed..86dbc9f62 100644
--- a/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscoverer.java
+++ b/archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscoverer.java
@@ -87,6 +87,13 @@ public class DefaultArtifactDiscoverer
type = "distribution-zip";
remainingFilename = remainingFilename.substring( 0, remainingFilename.length() - ".zip".length() );
}
+ else if ( remainingFilename.endsWith( "-test-sources.jar" ) )
+ {
+ type = "java-source";
+ classifier = "test-sources";
+ remainingFilename =
+ remainingFilename.substring( 0, remainingFilename.length() - "-test-sources.jar".length() );
+ }
else if ( remainingFilename.endsWith( "-sources.jar" ) )
{
type = "java-source";
diff --git a/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java b/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java
index 5c1529f3d..6a386ae7c 100644
--- a/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java
+++ b/archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java
@@ -364,6 +364,16 @@ public class DefaultArtifactDiscovererTest
createArtifact( "org.apache.maven", "testing", "1.0", "java-source", "sources" ) ) );
}
+ public void testTestSourcesInclusion()
+ throws DiscovererException
+{
+ List artifacts = discoverArtifactsWithSnapshots();
+ assertNotNull( "Check artifacts not null", artifacts );
+
+ assertTrue( "Check normal included", artifacts.contains(
+ createArtifact( "org.apache.maven", "testing", "1.0", "java-source", "test-sources" ) ) );
+}
+
public void testDistributionInclusion()
throws DiscovererException
{
diff --git a/archiva-discoverer/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar b/archiva-discoverer/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/archiva-discoverer/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar