Author: ffang
Date: Tue Mar 16 10:52:10 2010
New Revision: 923684

URL: http://svn.apache.org/viewvc?rev=923684&view=rev
Log:
[FELIX-2193] add-features-to-repo goal of features-maven-plugin should be able 
to download dependencies if necessary

Modified:
    felix/trunk/karaf/tooling/features-maven-plugin/pom.xml
    
felix/trunk/karaf/tooling/features-maven-plugin/src/main/java/org/apache/felix/karaf/tooling/features/AddFeaturesToRepoMojo.java

Modified: felix/trunk/karaf/tooling/features-maven-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/felix/trunk/karaf/tooling/features-maven-plugin/pom.xml?rev=923684&r1=923683&r2=923684&view=diff
==============================================================================
--- felix/trunk/karaf/tooling/features-maven-plugin/pom.xml (original)
+++ felix/trunk/karaf/tooling/features-maven-plugin/pom.xml Tue Mar 16 10:52:10 
2010
@@ -56,6 +56,10 @@
         <artifactId>org.apache.felix.karaf.features.core</artifactId>
       </dependency>
       <dependency>
+        <groupId>org.ops4j.pax.url</groupId>
+        <artifactId>pax-url-mvn</artifactId>
+      </dependency>
+      <dependency>
         <groupId>org.easymock</groupId>
         <artifactId>easymock</artifactId>
         <scope>test</scope>

Modified: 
felix/trunk/karaf/tooling/features-maven-plugin/src/main/java/org/apache/felix/karaf/tooling/features/AddFeaturesToRepoMojo.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/karaf/tooling/features-maven-plugin/src/main/java/org/apache/felix/karaf/tooling/features/AddFeaturesToRepoMojo.java?rev=923684&r1=923683&r2=923684&view=diff
==============================================================================
--- 
felix/trunk/karaf/tooling/features-maven-plugin/src/main/java/org/apache/felix/karaf/tooling/features/AddFeaturesToRepoMojo.java
 (original)
+++ 
felix/trunk/karaf/tooling/features-maven-plugin/src/main/java/org/apache/felix/karaf/tooling/features/AddFeaturesToRepoMojo.java
 Tue Mar 16 10:52:10 2010
@@ -46,6 +46,7 @@ import org.apache.maven.artifact.Artifac
 import org.apache.maven.artifact.DefaultArtifact;
 import org.apache.maven.artifact.handler.DefaultArtifactHandler;
 import org.apache.maven.artifact.versioning.VersionRange;
+import org.ops4j.pax.url.mvn.Handler;
 import org.xml.sax.SAXException;
 
 /**
@@ -99,6 +100,7 @@ public class AddFeaturesToRepoMojo exten
                 if (!bundle.startsWith("mvn:")) {
                     throw new MojoExecutionException("Bundle url is not a 
maven url: " + bundle);
                 }
+                              
                 String[] parts = bundle.substring("mvn:".length()).split("/");
                 String groupId = parts[0];
                 String artifactId = parts[1];
@@ -116,8 +118,8 @@ public class AddFeaturesToRepoMojo exten
                 }
                 String dir = groupId.replace('.', '/') + "/" + artifactId + 
"/" + version + "/";
                 String name = artifactId + "-" + version + (classifier != null 
? "-" + classifier : "") + "." + type;
-                System.out.println("Copy:      " + dir + name);
-                copy(new URL(getLocalRepoUrl() + "/" + dir + 
name).openStream(),
+                System.out.println("Copy:      " + bundle);
+                copy(new URL(null, bundle, new Handler()).openStream(),
                      repository,
                      name,
                      dir,


Reply via email to