You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2014/10/18 22:17:34 UTC

svn commit: r1632838 - in /maven/plugins/trunk/maven-deploy-plugin/src: main/java/org/apache/maven/plugin/deploy/ test/java/org/apache/maven/plugin/deploy/ test/resources/unit/basic-deploy-pom/ test/resources/unit/basic-deploy-scp/ test/resources/unit/...

Author: khmarbaise
Date: Sat Oct 18 20:17:34 2014
New Revision: 1632838

URL: http://svn.apache.org/r1632838
Log:
[MDEPLOY-171]
 - Removed deprecated marked entries.
   artifact, packaging, pomFile, attachedArtifacts fixed unit tests accordingly.

Modified:
    maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
    maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
    maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
    maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
    maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
    maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-test/plugin-config.xml
    maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
    maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml

Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java Sat Oct 18 20:17:34 2014
@@ -19,6 +19,14 @@ package org.apache.maven.plugin.deploy;
  * under the License.
  */
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
@@ -27,21 +35,12 @@ import org.apache.maven.artifact.reposit
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.LifecyclePhase;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.ProjectArtifactMetadata;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 /**
  * Deploys an artifact to remote repository.
  * 
@@ -83,24 +82,6 @@ public class DeployMojo
     private boolean deployAtEnd;
 
     /**
-     * @deprecated either use project.getArtifact() or reactorProjects.get(i).getArtifact()
-     */
-    @Parameter( defaultValue = "${project.artifact}", required = true, readonly = true )
-    private Artifact artifact;
-
-    /**
-     * @deprecated either use project.getPackaging() or reactorProjects.get(i).getPackaging()
-     */
-    @Parameter( defaultValue = "${project.packaging}", required = true, readonly = true )
-    private String packaging;
-
-    /**
-     * @deprecated either use project.getFile() or reactorProjects.get(i).getFile()
-     */
-    @Parameter( defaultValue = "${project.file}", required = true, readonly = true )
-    private File pomFile;
-
-    /**
      * Specifies an alternative repository to which the project artifacts should be deployed ( other than those
      * specified in &lt;distributionManagement&gt; ). <br/>
      * Format: id::layout::url
@@ -136,12 +117,6 @@ public class DeployMojo
     private String altReleaseDeploymentRepository;
 
     /**
-     * @deprecated either use project.getAttachedArtifacts() or reactorProjects.get(i).getAttachedArtifacts()
-     */
-    @Parameter( defaultValue = "${project.attachedArtifacts}", required = true, readonly = true )
-    private List attachedArtifacts;
-
-    /**
      * Set this to 'true' to bypass artifact deploy
      * 
      * @since 2.4

Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployFileMojoTest.java Sat Oct 18 20:17:34 2014
@@ -162,26 +162,6 @@ public class DeployFileMojoTest
         assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );
     }
 
-    public void testDeployIfPomFileParamIsSet()
-        throws Exception
-    {
-        File testPom = new File( getBasedir(), "target/test-classes/unit/deploy-file-pom-file/plugin-config.xml" );
-
-        DeployFileMojo mojo = (DeployFileMojo) lookupMojo( "deploy-file", testPom );
-
-        assertNotNull( mojo );
-
-        setVariableValueToObject( mojo, "project", projectStub );
-
-        File pomFile = ( File ) getVariableValueFromObject( mojo, "pomFile" );
-
-        assertNotNull( pomFile );
-
-        mojo.execute();
-
-        assertTrue( pomFile.exists() );
-    }
-
     public void testDeployIfClassifierIsSet()
         throws Exception
     {
@@ -241,16 +221,12 @@ public class DeployFileMojoTest
 
         String version = (String) getVariableValueFromObject( mojo, "version" );
 
-        String packaging = (String) getVariableValueFromObject( mojo, "packaging" );
-
         assertEquals( "org.apache.maven.test", groupId );
 
         assertEquals( "maven-deploy-file-test", artifactId );
 
         assertEquals( "1.0", version );
 
-        assertEquals( "zip", packaging );
-
         mojo.execute();
 
         File file = new File( remoteRepo, "deploy-file-artifact-not-jar/" + groupId.replace( '.', '/' ) +

Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java Sat Oct 18 20:17:34 2014
@@ -31,7 +31,6 @@ import java.util.Properties;
 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.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.deploy.stubs.ArtifactDeployerStub;
 import org.apache.maven.plugin.deploy.stubs.ArtifactRepositoryStub;
@@ -274,17 +273,13 @@ public class DeployMojoTest
         
         assertNotNull( mojo );
         
-        String packaging = ( String ) getVariableValueFromObject( mojo, "packaging" );
-        
-        assertEquals( "pom", packaging );
-        
         MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
 
         setVariableValueToObject( mojo, "reactorProjects", Collections.singletonList( project ) );
 
         artifact = (DeployArtifactStub) project.getArtifact();
         
-        artifact.setArtifactHandlerExtension( packaging );
+        artifact.setArtifactHandlerExtension( project.getPackaging() );
         
         ArtifactRepositoryStub repo = getRepoStub( mojo );
         

Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-pom/plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-pom/plugin-config.xml?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-pom/plugin-config.xml (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-pom/plugin-config.xml Sat Oct 18 20:17:34 2014
@@ -23,12 +23,6 @@ under the License.
       <plugin>
         <artifactId>maven-deploy-plugin</artifactId>
         <configuration>
-          <!-- derecated fields -->
-          <pomFile>${basedir}/src/test/resources/unit/basic-deploy-pom/plugin-config.xml</pomFile>
-          <packaging>pom</packaging>
-          <artifact implementation="org.apache.maven.plugin.deploy.stubs.DeployArtifactStub" />
-          <attachedArtifacts />
-          
           <localRepository>${localRepository}</localRepository>
           <project implementation="org.apache.maven.plugin.deploy.stubs.MavenProjectStub">
             <file>${basedir}/src/test/resources/unit/basic-deploy-pom/plugin-config.xml</file>

Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-scp/plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-scp/plugin-config.xml?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-scp/plugin-config.xml (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-scp/plugin-config.xml Sat Oct 18 20:17:34 2014
@@ -23,12 +23,6 @@ under the License.
       <plugin>
         <artifactId>maven-deploy-plugin</artifactId>
         <configuration>
-          <!-- deprecated fields -->
-          <pomFile>${basedir}/src/test/resources/unit/basic-deploy-scp/plugin-config.xml</pomFile>
-          <packaging>jar</packaging>
-          <artifact implementation="org.apache.maven.plugin.deploy.stubs.DeployArtifactStub" />
-          <attachedArtifacts />
-          
           <localRepository>${localRepository}</localRepository>
           <project implementation="org.apache.maven.plugin.deploy.stubs.MavenProjectStub">
             <file>${basedir}/src/test/resources/unit/basic-deploy-scp/plugin-config.xml</file>

Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-test/plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-test/plugin-config.xml?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
Files maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-test/plugin-config.xml (original) and maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-test/plugin-config.xml Sat Oct 18 20:17:34 2014 differ

Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml Sat Oct 18 20:17:34 2014
@@ -23,14 +23,6 @@ under the License.
       <plugin>
         <artifactId>maven-deploy-plugin</artifactId>
         <configuration>
-          <!-- deprecated fields -->
-          <pomFile>${basedir}/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml</pomFile>
-          <packaging>jar</packaging>
-          <artifact implementation="org.apache.maven.plugin.deploy.stubs.DeployArtifactStub" />
-          <attachedArtifacts>
-            <attachedArtifact implementation="org.apache.maven.plugin.deploy.stubs.AttachedArtifactStub" />
-          </attachedArtifacts>
-          
           <localRepository>${localRepository}</localRepository>
             <project implementation="org.apache.maven.plugin.deploy.stubs.MavenProjectStub">
             <file>${basedir}/src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml</file>

Modified: maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml?rev=1632838&r1=1632837&r2=1632838&view=diff
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml (original)
+++ maven/plugins/trunk/maven-deploy-plugin/src/test/resources/unit/deploy-file-artifact-not-jar/plugin-config.xml Sat Oct 18 20:17:34 2014
@@ -26,7 +26,6 @@ under the License.
           <groupId>org.apache.maven.test</groupId>
           <artifactId>maven-deploy-file-test</artifactId>
           <version>1.0</version>
-          <packaging>zip</packaging>
           <file>${basedir}/src/test/resources/unit/deploy-file-artifact-not-jar/target/deploy-test-file.zip</file>
           <repositoryId>deploy-test</repositoryId>
           <url>file://${basedir}/target/remote-repo/deploy-file-artifact-not-jar</url>