]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1360] move type population into Maven 2 plugin
authorBrett Porter <brett@apache.org>
Wed, 10 Mar 2010 04:21:54 +0000 (04:21 +0000)
committerBrett Porter <brett@apache.org>
Wed, 10 Mar 2010 04:21:54 +0000 (04:21 +0000)
- correct problem with the instantiation of the translator in the legacy code

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@921227 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java

index b9e6c674a5d2bf58beb042513ee2aca86975932e..abea4a6b7fd934e8efa588de41834bd793b2f867 100644 (file)
@@ -21,12 +21,16 @@ package org.apache.maven.archiva.repository.content;
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
+import org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider;
+import org.apache.archiva.metadata.repository.storage.maven2.DefaultArtifactMappingProvider;
 import org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
+import java.util.Collections;
+
 /**
  * DefaultPathParser is a parser for maven 2 (default layout) paths to ArtifactReference.
  *
@@ -38,7 +42,8 @@ public class DefaultPathParser implements PathParser
 {
     private static final String INVALID_ARTIFACT_PATH = "Invalid path to Artifact: ";
 
-    private RepositoryPathTranslator pathTranslator = new Maven2RepositoryPathTranslator();
+    private RepositoryPathTranslator pathTranslator = new Maven2RepositoryPathTranslator(
+        Collections.<ArtifactMappingProvider>singletonList( new DefaultArtifactMappingProvider() ) );
 
     /**
      * {@inheritDoc}
index 2ff02478fce5f455ad73c203d61724ca219f90dd..5a255c2747c1dd27f3607c079222783c2bd3f49b 100644 (file)
@@ -45,6 +45,15 @@ public class Maven2RepositoryPathTranslator
      */
     private List<ArtifactMappingProvider> artifactMappingProviders;
 
+    public Maven2RepositoryPathTranslator()
+    {
+    }
+
+    public Maven2RepositoryPathTranslator( List<ArtifactMappingProvider> artifactMappingProviders )
+    {
+        this.artifactMappingProviders = artifactMappingProviders;
+    }
+
     public File toFile( File basedir, String namespace, String projectId, String projectVersion, String filename )
     {
         return new File( basedir, toPath( namespace, projectId, projectVersion, filename ) );