Allow specification of a default classfier, in addition to a default type.
authorJohn Dennis Casey <jdcasey@apache.org>
Mon, 6 Aug 2007 22:20:23 +0000 (22:20 +0000)
committerJohn Dennis Casey <jdcasey@apache.org>
Mon, 6 Aug 2007 22:20:23 +0000 (22:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@563307 13f79535-47bb-0310-9956-ffa450edef68

pom.xml
src/main/java/org/apache/maven/shared/io/location/ArtifactLocatorStrategy.java

diff --git a/pom.xml b/pom.xml
index b34cb9c..7bf3f7c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/trunk/maven-shared-io</developerConnection>
     <url>http://svn.apache.org/viewcvs.cgi/maven/shared/trunk/maven-shared-io</url>
   </scm>
+  
+  <distributionManagement>
+    <snapshotRepository>
+      <id>apache.snapshots</id>
+      <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
+    </snapshotRepository>
+    <repository>
+      <id>apache</id>
+      <url>scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
+    </repository>
+  </distributionManagement>
 </project>
index 91f7d77..ff75634 100644 (file)
@@ -23,6 +23,8 @@ public class ArtifactLocatorStrategy
 
     private final List remoteRepositories;
 
+    private String defaultClassifier = null;
+
     public ArtifactLocatorStrategy( ArtifactFactory factory, ArtifactResolver resolver,
                                     ArtifactRepository localRepository, List remoteRepositories )
     {
@@ -43,6 +45,18 @@ public class ArtifactLocatorStrategy
         this.defaultArtifactType = defaultArtifactType;
     }
 
+    public ArtifactLocatorStrategy( ArtifactFactory factory, ArtifactResolver resolver,
+                                    ArtifactRepository localRepository, List remoteRepositories,
+                                    String defaultArtifactType, String defaultClassifier )
+    {
+        this.factory = factory;
+        this.resolver = resolver;
+        this.localRepository = localRepository;
+        this.remoteRepositories = remoteRepositories;
+        this.defaultArtifactType = defaultArtifactType;
+        this.defaultClassifier = defaultClassifier;
+    }
+
     /**
      * Assumes artifact identity is given in a set of comma-delimited tokens of
      * the form: <code>groupId:artifactId:version:type:classifier</code>, where
@@ -69,7 +83,7 @@ public class ArtifactLocatorStrategy
                 }
             }
 
-            String classifier = null;
+            String classifier = defaultClassifier;
             if ( parts.length > 4 )
             {
                 classifier = parts[4];