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 2018/05/01 21:41:40 UTC

[maven-deploy-plugin] branch MSHARED-695 created (now 85e380e)

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a change to branch MSHARED-695
in repository https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git.


      at 85e380e  [MSHARED-695] - WIP - Move checksum generation from install to deploy

This branch includes the following new commits:

     new 85e380e  [MSHARED-695] - WIP - Move checksum generation from install to deploy

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.

[maven-deploy-plugin] 01/01: [MSHARED-695] - WIP - Move checksum generation from install to deploy

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch MSHARED-695
in repository https://gitbox.apache.org/repos/asf/maven-deploy-plugin.git

commit 85e380ea6a8ecce2ce01c92e7db9c06fbe4ef02f
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Apr 11 19:49:07 2018 +0200

    [MSHARED-695] - WIP - Move checksum generation from install to deploy
---
 pom.xml                                            |  2 +-
 .../apache/maven/plugins/deploy/DeployMojo.java    |  6 +-
 .../maven/plugins/deploy/DeployMojoTest.java       | 74 +++++++++++-----------
 3 files changed, 43 insertions(+), 39 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8364997..e201a0d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@ under the License.
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-artifact-transfer</artifactId>
-      <version>0.9.1</version>
+      <version>0.9.2-SNAPSHOT</version>
     </dependency>
     <!-- Upgrade of transitive dependency. -->
     <dependency>
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
index 812b22d..229fd47 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -36,6 +36,7 @@ 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.ProjectBuildingRequest;
+import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
 import org.apache.maven.shared.project.NoFileAssignedException;
 import org.apache.maven.shared.project.deploy.ProjectDeployer;
 import org.apache.maven.shared.project.deploy.ProjectDeployerRequest;
@@ -144,7 +145,6 @@ public class DeployMojo
             // @formatter:off
             ProjectDeployerRequest pdr = new ProjectDeployerRequest()
                 .setProject( project )
-                .setUpdateReleaseInfo( isUpdateReleaseInfo() )
                 .setRetryFailedDeploymentCount( getRetryFailedDeploymentCount() )
                 .setAltReleaseDeploymentRepository( altReleaseDeploymentRepository )
                 .setAltSnapshotDeploymentRepository( altSnapshotDeploymentRepository )
@@ -196,6 +196,10 @@ public class DeployMojo
         {
             throw new MojoExecutionException( "NoFileAssignedException", e );
         }
+        catch ( ArtifactDeployerException e )
+        {
+            throw new MojoExecutionException( "ArtifactDeployerException", e );
+        }
 
     }
 
diff --git a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
index 4db5b2d..9cf69eb 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -360,43 +360,43 @@ public class DeployMojoTest
         assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );    
     }
 
-    public void testUpdateReleaseParamSetToTrue()
-        throws Exception
-    {
-        File testPom = new File( getBasedir(),
-                                 "target/test-classes/unit/basic-deploy-pom/plugin-config.xml" );
-        mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
-        
-        MockitoAnnotations.initMocks( this );
-        
-        assertNotNull( mojo );
-        
-        ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
-        when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
-        MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
-        repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
-        when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
-        
-        boolean updateReleaseInfo = (Boolean) getVariableValueFromObject(mojo, "updateReleaseInfo");
-        
-        assertTrue( updateReleaseInfo );
-        
-        MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
-
-        setVariableValueToObject( mojo, "reactorProjects", Collections.singletonList( project ) );
-
-        artifact = (DeployArtifactStub) project.getArtifact();
-        
-        artifact.setFile( testPom );
-        
-        ArtifactRepositoryStub repo = getRepoStub( mojo );
-        
-        repo.setAppendToUrl( "basic-deploy-updateReleaseParam" );        
-        
-        mojo.execute();
-        
-        assertTrue( artifact.isRelease() );
-    }
+//    public void testUpdateReleaseParamSetToTrue()
+//        throws Exception
+//    {
+//        File testPom = new File( getBasedir(),
+//                                 "target/test-classes/unit/basic-deploy-pom/plugin-config.xml" );
+//        mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+//        
+//        MockitoAnnotations.initMocks( this );
+//        
+//        assertNotNull( mojo );
+//        
+//        ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
+//        when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
+//        MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
+//        repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
+//        when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
+//        
+//        boolean updateReleaseInfo = (Boolean) getVariableValueFromObject(mojo, "updateReleaseInfo");
+//        
+//        assertTrue( updateReleaseInfo );
+//        
+//        MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
+//
+//        setVariableValueToObject( mojo, "reactorProjects", Collections.singletonList( project ) );
+//
+//        artifact = (DeployArtifactStub) project.getArtifact();
+//        
+//        artifact.setFile( testPom );
+//        
+//        ArtifactRepositoryStub repo = getRepoStub( mojo );
+//        
+//        repo.setAppendToUrl( "basic-deploy-updateReleaseParam" );        
+//        
+//        mojo.execute();
+//        
+//        assertTrue( artifact.isRelease() );
+//    }
 
     public void testDeployIfArtifactFileIsNull()
         throws Exception

-- 
To stop receiving notification emails like this one, please contact
khmarbaise@apache.org.