maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1689953 - in /maven/plugins/trunk/maven-dependency-plugin: ./ src/main/java/org/apache/maven/plugin/dependency/ src/main/java/org/apache/maven/plugin/dependency/fromDependencies/ src/test/java/org/apache/maven/plugin/dependency/fromDepende...
Date Wed, 08 Jul 2015 20:15:12 GMT
Author: rfscholte
Date: Wed Jul  8 20:15:12 2015
New Revision: 1689953

URL: http://svn.apache.org/r1689953
Log:
[MDEP-494] Remove/replace Maven2 specific code
ArtifactRepositoryFactory usage replaced
maven-compat now has test-scope, YEAH!

Modified:
    maven/plugins/trunk/maven-dependency-plugin/pom.xml
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
    maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestCopyDependenciesMojo2.java

Modified: maven/plugins/trunk/maven-dependency-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/pom.xml?rev=1689953&r1=1689952&r2=1689953&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-dependency-plugin/pom.xml Wed Jul  8 20:15:12 2015
@@ -91,6 +91,7 @@ under the License.
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-compat</artifactId>
       <version>${mavenVersion}</version>
+      <scope>test</scope>
     </dependency>
   
     <!-- maven -->

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java?rev=1689953&r1=1689952&r2=1689953&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
Wed Jul  8 20:15:12 2015
@@ -29,8 +29,8 @@ import java.util.regex.Pattern;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
@@ -72,12 +72,6 @@ public class GetMojo
     private ArtifactResolver artifactResolver;
 
     /**
-     *
-     */
-    @Component
-    private ArtifactRepositoryFactory artifactRepositoryFactory;
-
-    /**
      * Map that contains the layouts.
      */
     @Component( role = ArtifactRepositoryLayout.class )
@@ -263,7 +257,7 @@ public class GetMojo
             }
             url = matcher.group( 3 ).trim();
         }
-        return artifactRepositoryFactory.createArtifactRepository( id, url, layout, policy,
policy );
+        return new MavenArtifactRepository( id, url, layout, policy, policy );
     }
 
     private ArtifactRepositoryLayout getLayout( String id )

Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java?rev=1689953&r1=1689952&r2=1689953&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromDependencies/CopyDependenciesMojo.java
Wed Jul  8 20:15:12 2015
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.dependen
  */
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.dependency.utils.DependencyStatusSets;
@@ -72,12 +71,6 @@ public class CopyDependenciesMojo
 
     /**
      *
-     */
-    @Component
-    protected ArtifactRepositoryFactory repositoryFactory;
-
-    /**
-     *
      */
     @Component( role = ArtifactRepositoryLayout.class )
     private Map<String, ArtifactRepositoryLayout> repositoryLayouts;

Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestCopyDependenciesMojo2.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestCopyDependenciesMojo2.java?rev=1689953&r1=1689952&r2=1689953&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestCopyDependenciesMojo2.java
(original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromDependencies/TestCopyDependenciesMojo2.java
Wed Jul  8 20:15:12 2015
@@ -28,6 +28,8 @@ import java.util.Set;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
 import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
 import org.apache.maven.artifact.repository.metadata.Snapshot;
@@ -289,11 +291,12 @@ public class TestCopyDependenciesMojo2
         mojo.execute();
         
         File outputDirectory = mojo.outputDirectory;
-		ArtifactRepository targetRepository = mojo.repositoryFactory.createDeploymentArtifactRepository(

+		ArtifactRepository targetRepository = new MavenArtifactRepository( 
         		"local", 
         		outputDirectory.toURL().toExternalForm(), 
                 new DefaultRepositoryLayout(),
-                false );
+                new ArtifactRepositoryPolicy(), 
+                new ArtifactRepositoryPolicy() );
 
         Set<Artifact> artifacts = mojo.getProject().getArtifacts();
         for ( Artifact artifact : artifacts )



Mime
View raw message