Index: src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java =================================================================== --- src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java (revision 595585) +++ src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java (working copy) @@ -28,17 +28,14 @@ import java.util.Map; /** - * AbstractLegacyRepositoryContent + * AbstractLegacyRepositoryContent * * @author Joakim Erdfelt * @version $Id$ */ public abstract class AbstractLegacyRepositoryContent { - private static final String DIR_JAVADOC = "javadoc.jars"; - private static final String DIR_JAVA_SOURCE = "java-sources"; - private static final String PATH_SEPARATOR = "/"; private static final Map typeToDirectoryMap; @@ -50,6 +47,7 @@ typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_PLUGIN, "plugin" ); typeToDirectoryMap.put( "distribution-tgz", "distribution" ); typeToDirectoryMap.put( "distribution-zip", "distribution" ); + typeToDirectoryMap.put( "javadoc", "javadoc.jar" ); } public ArtifactReference toArtifactReference( String path ) @@ -57,7 +55,7 @@ { return LegacyPathParser.toArtifactReference( path ); } - + public String toPath( ArchivaArtifact reference ) { if ( reference == null ) @@ -104,21 +102,6 @@ private String getDirectory( String classifier, String type ) { - // Special Cases involving type + classifier - if ( "jar".equals( type ) && StringUtils.isNotBlank( classifier ) ) - { - if ( "sources".equals( classifier ) ) - { - return DIR_JAVA_SOURCE; - } - - if ( "javadoc".equals( classifier ) ) - { - return DIR_JAVADOC; - } - } - - // Special Cases involving only type. String dirname = (String) typeToDirectoryMap.get( type ); if ( dirname != null ) Index: src/main/java/org/apache/maven/archiva/repository/content/ArtifactClassifierMapping.java =================================================================== --- src/main/java/org/apache/maven/archiva/repository/content/ArtifactClassifierMapping.java (revision 0) +++ src/main/java/org/apache/maven/archiva/repository/content/ArtifactClassifierMapping.java (revision 0) @@ -0,0 +1,56 @@ +package org.apache.maven.archiva.repository.content; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.commons.lang.StringUtils; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Pattern; + +/** + * ArtifactExtensionMapping + * + */ +public class ArtifactClassifierMapping +{ + private static final Map typeToClassifierMap; + + static + { + typeToClassifierMap = new HashMap(); + typeToClassifierMap.put( "java-source", "sources" ); + typeToClassifierMap.put( "javadoc.jar", "javadoc" ); + typeToClassifierMap.put( "javadoc", "javadoc" ); + } + + public static String getClassifier( String type ) + { + // Try specialized types first. + if ( typeToClassifierMap.containsKey( type ) ) + { + return (String) typeToClassifierMap.get( type ); + } + + // No classifier + return null; + } +} Index: src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java =================================================================== --- src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java (revision 595585) +++ src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java (working copy) @@ -157,6 +157,19 @@ } } + String classifier = ArtifactClassifierMapping.getClassifier( artifact.getType() ); + if ( classifier != null ) + { + String version = artifact.getVersion(); + if ( ! version.endsWith( "-" + classifier ) ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + expectedType + " artifacts must use the classifier " + classifier ); + } + version = version.substring( 0, version.length() - classifier.length() - 1 ); + artifact.setVersion( version ); + artifact.setClassifier( classifier ); + } + return artifact; } } Index: src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java =================================================================== --- src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java (revision 595585) +++ src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java (working copy) @@ -72,13 +72,13 @@ String type = "jar"; String path = "ch.ethz.ganymed/jars/ganymed-ssh2-build210.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - /** + /** * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. - * @throws LayoutException + * @throws LayoutException */ public void testGoodButOddVersionSpecJavaxComm() throws LayoutException @@ -89,13 +89,13 @@ String type = "jar"; String path = "javax/jars/comm-3.0-u1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - /** + /** * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. - * @throws LayoutException + * @throws LayoutException */ public void testGoodButOddVersionSpecJavaxPersistence() throws LayoutException @@ -106,12 +106,12 @@ String type = "jar"; String path = "javax.persistence/jars/ejb-3.0-public_review.jar"; - /* + /* * The version id of "public_review" can cause problems. is it part of * the version spec? or the classifier? */ - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodCommonsLang() @@ -123,7 +123,7 @@ String type = "jar"; String path = "commons-lang/jars/commons-lang-2.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodDerby() @@ -135,16 +135,16 @@ String type = "jar"; String path = "org.apache.derby/jars/derby-10.2.2.0.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** * Test the ejb-client type spec. - * Type specs are not a 1 to 1 map to the extension. + * Type specs are not a 1 to 1 map to the extension. * This tests that effect. - * @throws LayoutException + * @throws LayoutException */ - /* TODO: Re-enabled in the future. + /* TODO: Re-enabled in the future. public void testGoodFooEjbClient() throws LayoutException { @@ -160,34 +160,36 @@ /** * Test the classifier. - * @throws LayoutException + * @throws LayoutException */ public void testGoodFooLibJavadoc() throws LayoutException { String groupId = "com.foo.lib"; String artifactId = "foo-lib"; - String version = "2.1-alpha-1-javadoc"; + String version = "2.1-alpha-1"; String type = "javadoc"; - String path = "com.foo.lib/javadocs/foo-lib-2.1-alpha-1-javadoc.jar"; + String classifier = "javadoc"; + String path = "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-javadoc.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, classifier, type ); } /** * Test the classifier, and java-source type spec. - * @throws LayoutException + * @throws LayoutException */ public void testGoodFooLibSources() throws LayoutException { String groupId = "com.foo.lib"; String artifactId = "foo-lib"; - String version = "2.1-alpha-1-sources"; + String version = "2.1-alpha-1"; String type = "java-source"; // oddball type-spec (should result in jar extension) + String classifier = "sources"; String path = "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-sources.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, classifier, type ); } public void testGoodFooTool() @@ -199,7 +201,7 @@ String type = "jar"; String path = "com.foo/jars/foo-tool-1.0.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodGeronimoEjbSpec() @@ -211,7 +213,7 @@ String type = "jar"; String path = "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodLdapClientsPom() @@ -223,12 +225,12 @@ String type = "pom"; String path = "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. - * @throws LayoutException + * @throws LayoutException */ public void testGoodSnapshotMavenTest() throws LayoutException @@ -239,7 +241,7 @@ String type = "jar"; String path = "org.apache.archiva.test/jars/redonkulous-3.1-beta-1-20050831.101112-42.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** @@ -256,9 +258,9 @@ String path = "maven/poms/maven-test-plugin-1.8.2.pom"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. * Example uses "test" in artifact Id, which is also part of the versionKeyword list. @@ -272,9 +274,9 @@ String type = "maven-plugin"; String path = "maven/plugins/maven-test-plugin-1.8.2.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. */ @@ -287,9 +289,9 @@ String type = "maven-plugin"; String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. */ @@ -302,9 +304,9 @@ String type = "maven-plugin"; String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. */ @@ -317,33 +319,34 @@ String type = "maven-plugin"; String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** * Perform a roundtrip through the layout routines to determine success. + * @param classifier TODO */ - private void assertLayout( String path, String groupId, String artifactId, String version, String type ) + private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, String type ) throws LayoutException { - ArtifactReference expectedArtifact = createArtifact( groupId, artifactId, version, type ); + ArtifactReference expectedArtifact = createArtifact( groupId, artifactId, version, classifier, type ); // --- Artifact Tests. - // Artifact to Path + // Artifact to Path assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( expectedArtifact ) ); // --- Artifact Reference Tests // Path to Artifact Reference. ArtifactReference testReference = toArtifactReference( path ); - assertArtifactReference( testReference, groupId, artifactId, version, type ); + assertArtifactReference( testReference, groupId, artifactId, version, classifier, type ); // And back again, using test Reference from previous step. assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( testReference ) ); } - + private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId, - String version, String type ) + String version, String classifier, String type ) { String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + type; @@ -352,17 +355,17 @@ assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() ); assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() ); assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() ); + assertEquals( expectedId + " - classifier", classifier, actualReference.getClassifier() ); assertEquals( expectedId + " - Type", type, actualReference.getType() ); - // legacy has no classifier. - assertNull( expectedId + " - classifier", actualReference.getClassifier() ); } - - protected ArtifactReference createArtifact( String groupId, String artifactId, String version, String type ) + + protected ArtifactReference createArtifact( String groupId, String artifactId, String version, String classifier, String type ) { ArtifactReference artifact = new ArtifactReference(); artifact.setGroupId( groupId ); artifact.setArtifactId( artifactId ); artifact.setVersion( version ); + artifact.setClassifier( classifier ); artifact.setType( type ); assertNotNull( artifact ); return artifact; Index: src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java =================================================================== --- src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java (revision 595585) +++ src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java (working copy) @@ -25,7 +25,7 @@ import org.apache.maven.archiva.repository.layout.LayoutException; /** - * LegacyPathParserTest + * LegacyPathParserTest * * @author Joakim Erdfelt * @version $Id$ @@ -58,9 +58,9 @@ { assertBadPath( "org.apache.maven.test/jars/artifactId-1.0.war", "wrong package extension" ); } - - /** - * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error + + /** + * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error */ public void testGoodButDualExtensions() throws LayoutException @@ -71,13 +71,13 @@ String type = "distribution-zip"; String path = "org.project/zips/example-presentation-3.2.xml.zip"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - /** + /** * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. - * @throws LayoutException + * @throws LayoutException */ public void testGoodButOddVersionSpecGanymedSsh2() throws LayoutException @@ -88,13 +88,13 @@ String type = "jar"; String path = "ch.ethz.ganymed/jars/ganymed-ssh2-build210.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - /** + /** * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. - * @throws LayoutException + * @throws LayoutException */ public void testGoodButOddVersionSpecJavaxComm() throws LayoutException @@ -105,13 +105,13 @@ String type = "jar"; String path = "javax/jars/comm-3.0-u1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - /** + /** * [MRM-432] Oddball version spec. * Example of an oddball / unusual version spec. - * @throws LayoutException + * @throws LayoutException */ public void testGoodButOddVersionSpecJavaxPersistence() throws LayoutException @@ -122,12 +122,12 @@ String type = "jar"; String path = "javax.persistence/jars/ejb-3.0-public_review.jar"; - /* + /* * The version id of "public_review" can cause problems. is it part of * the version spec? or the classifier? */ - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodCommonsLang() @@ -139,7 +139,7 @@ String type = "jar"; String path = "commons-lang/jars/commons-lang-2.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodDerby() @@ -151,16 +151,16 @@ String type = "jar"; String path = "org.apache.derby/jars/derby-10.2.2.0.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** * Test the ejb-client type spec. - * Type specs are not a 1 to 1 map to the extension. + * Type specs are not a 1 to 1 map to the extension. * This tests that effect. - * @throws LayoutException + * @throws LayoutException */ - /* TODO: Re-enabled in the future. + /* TODO: Re-enabled in the future. public void testGoodFooEjbClient() throws LayoutException { @@ -176,34 +176,36 @@ /** * Test the classifier. - * @throws LayoutException + * @throws LayoutException */ public void testGoodFooLibJavadoc() throws LayoutException { String groupId = "com.foo.lib"; String artifactId = "foo-lib"; - String version = "2.1-alpha-1-javadoc"; + String version = "2.1-alpha-1"; String type = "javadoc"; - String path = "com.foo.lib/javadocs/foo-lib-2.1-alpha-1-javadoc.jar"; + String classifier = "javadoc"; + String path = "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-javadoc.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, classifier, type ); } /** * Test the classifier, and java-source type spec. - * @throws LayoutException + * @throws LayoutException */ public void testGoodFooLibSources() throws LayoutException { String groupId = "com.foo.lib"; String artifactId = "foo-lib"; - String version = "2.1-alpha-1-sources"; + String version = "2.1-alpha-1"; String type = "java-source"; // oddball type-spec (should result in jar extension) + String classifier= "sources"; String path = "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-sources.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, classifier, type ); } public void testGoodFooTool() @@ -215,7 +217,7 @@ String type = "jar"; String path = "com.foo/jars/foo-tool-1.0.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodGeronimoEjbSpec() @@ -227,7 +229,7 @@ String type = "jar"; String path = "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } public void testGoodLdapClientsPom() @@ -239,12 +241,12 @@ String type = "pom"; String path = "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. - * @throws LayoutException + * @throws LayoutException */ public void testGoodSnapshotMavenTest() throws LayoutException @@ -255,7 +257,7 @@ String type = "jar"; String path = "org.apache.archiva.test/jars/redonkulous-3.1-beta-1-20050831.101112-42.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** @@ -272,9 +274,9 @@ String path = "maven/poms/maven-test-plugin-1.8.2.pom"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. * Example uses "test" in artifact Id, which is also part of the versionKeyword list. @@ -288,9 +290,9 @@ String type = "maven-plugin"; String path = "maven/plugins/maven-test-plugin-1.8.2.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. */ @@ -303,9 +305,9 @@ String type = "maven-plugin"; String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. */ @@ -318,9 +320,9 @@ String type = "maven-plugin"; String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } - + /** * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. */ @@ -333,22 +335,23 @@ String type = "maven-plugin"; String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar"; - assertLayout( path, groupId, artifactId, version, type ); + assertLayout( path, groupId, artifactId, version, null, type ); } /** - * Perform a path to artifact reference lookup, and verify the results. + * Perform a path to artifact reference lookup, and verify the results. + * @param classifier TODO */ - private void assertLayout( String path, String groupId, String artifactId, String version, String type ) + private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, String type ) throws LayoutException { // Path to Artifact Reference. ArtifactReference testReference = LegacyPathParser.toArtifactReference( path ); - assertArtifactReference( testReference, groupId, artifactId, version, type ); + assertArtifactReference( testReference, groupId, artifactId, version, classifier, type ); } private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId, - String version, String type ) + String version, String classifier, String type ) { String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + type; @@ -357,9 +360,8 @@ assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() ); assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() ); assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() ); + assertEquals( expectedId + " - classifier", classifier, actualReference.getClassifier() ); assertEquals( expectedId + " - Type", type, actualReference.getType() ); - // legacy has no classifier. - assertNull( expectedId + " - classifier", actualReference.getClassifier() ); } protected void assertBadPath( String path, String reason ) Index: src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java =================================================================== --- src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java (revision 595585) +++ src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java (working copy) @@ -34,7 +34,7 @@ import java.util.Set; /** - * ManagedLegacyRepositoryContentTest + * ManagedLegacyRepositoryContentTest * * @author Joakim Erdfelt * @version $Id$ @@ -49,8 +49,8 @@ { assertVersions( "org.apache.maven", "testing", new String[] { "UNKNOWN", - "1.0-javadoc", - "1.0-sources", +// "1.0-javadoc", +// "1.0-sources", "1.0", "1.0-20050611.112233-1" } ); } @@ -59,8 +59,8 @@ throws Exception { assertVersions( "org.apache.maven", "testing", "1.0", new String[] { - "1.0-javadoc", - "1.0-sources", +// "1.0-javadoc", +// "1.0-sources", "1.0", "1.0-20050611.112233-1" } ); } @@ -119,7 +119,7 @@ public void testGetRelatedArtifacts() throws Exception { - ArtifactReference reference = createArtifact( "org.apache.maven", "testing", "1.0", "jar" ); + ArtifactReference reference = createArtifact( "org.apache.maven", "testing", "1.0", null, "jar" ); Set related = repoContent.getRelatedArtifacts( reference ); assertNotNull( related ); @@ -129,7 +129,7 @@ "org.apache.maven/java-sources/testing-1.0-sources.jar", "org.apache.maven/jars/testing-1.0-20050611.112233-1.jar", "org.apache.maven/poms/testing-1.0.pom", - "org.apache.maven/javadocs/testing-1.0-javadoc.jar" }; + "org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar" }; StringBuffer relatedDebugString = new StringBuffer(); relatedDebugString.append( "[" ); Index: src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java =================================================================== --- src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java (revision 595585) +++ src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java (working copy) @@ -28,7 +28,7 @@ import java.io.File; /** - * RepositoryRequestTest + * RepositoryRequestTest * * @author Joakim Erdfelt * @version $Id$ @@ -112,8 +112,8 @@ public void testValidLegacyCommonsLangJavadoc() throws Exception { - assertValid( "commons-lang/jars/commons-lang-2.1-javadoc.jar", "commons-lang", "commons-lang", "2.1-javadoc", - null, "javadoc" ); + assertValid( "commons-lang/javadoc.jars/commons-lang-2.1-javadoc.jar", "commons-lang", "commons-lang", "2.1", + "javadoc", "javadoc" ); } public void testValidDefaultCommonsLangJavadoc() Index: src/test/repositories/legacy-repository/org.apache.maven/javadocs/testing-1.0-javadoc.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/java-archive Index: src/test/repositories/legacy-repository/org.apache.maven/javadocs/testing-1.0-javadoc.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/java-archive