o Fixed API misuse
authorBenjamin Bentmann <bentmann@apache.org>
Sun, 20 Dec 2009 22:36:12 +0000 (22:36 +0000)
committerBenjamin Bentmann <bentmann@apache.org>
Sun, 20 Dec 2009 22:36:12 +0000 (22:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@892671 13f79535-47bb-0310-9956-ffa450edef68

pom.xml
src/main/java/org/apache/maven/plugin/deploy/AbstractDeployMojo.java
src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java
src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java

diff --git a/pom.xml b/pom.xml
index 5c88887..c850ae2 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -72,11 +72,6 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact-manager</artifactId>
-      <version>${mavenVersion}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
       <version>${mavenVersion}</version>
     </dependency>
index 66350b4..458f094 100644 (file)
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.maven.artifact.deployer.ArtifactDeployer;
 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.layout.ArtifactRepositoryLayout;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -48,6 +49,13 @@ public abstract class AbstractDeployMojo
     protected ArtifactFactory artifactFactory;
 
     /**
+     * Component used to create a repository.
+     *
+     * @component
+     */
+    ArtifactRepositoryFactory repositoryFactory;
+
+    /**
      * Map that contains the layouts.
      *
      * @component role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout"
index a4a1ff8..4f28109 100644 (file)
@@ -23,7 +23,6 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Parent;
@@ -127,13 +126,6 @@ public class DeployFileMojo
     private String url;
 
     /**
-     * Component used to create a repository
-     *
-     * @component
-     */
-    private ArtifactRepositoryFactory repositoryFactory;
-
-    /**
      * Location of an existing POM file to be deployed alongside the main
      * artifact, given by the ${file} parameter.
      * 
index 0c77ca4..5296666 100644 (file)
@@ -23,7 +23,6 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.DefaultArtifactRepository;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
@@ -214,8 +213,8 @@ public class DeployMojo
                 String url = matcher.group( 3 ).trim();
 
                 ArtifactRepositoryLayout repoLayout = getLayout( layout );
-                
-                repo = new DefaultArtifactRepository( id, url, repoLayout );
+
+                repo = repositoryFactory.createDeploymentArtifactRepository( id, url, repoLayout, true );
             }
         }