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/08/04 08:30:43 UTC

[maven-deploy-plugin] branch MSHARED-695 updated (2b33b19 -> 783bd1d)

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.


 discard 2b33b19  WIP - Upgraded release test WIP - Need to reconsider check in SNAPSHOT test       cause I can't predict the names correct.       Need to think about this (Will fail at the moment.).
 discard 90f4eb7  WIP - Upgraded maven-javadoc-plugin to 3.0.1 based on NPE issue WIP - Upgraded imports etc. in code. WIP - Add TLSv 1.2 configuration for maven-invoker-plugin to JDK 7
 discard b7c8590  fixup! [MSHARED-695] - WIP - Move checksum generation from install to deploy  o stat of IT's. to check for checksums.
 discard 6c3df7d  [MSHARED-695] - WIP - Move checksum generation from install to deploy  o stat of IT's. to check for checksums.
 discard ef55990  Upgrade maven-javadoc-plugin to version 3.0.0 to get it running in JDK 10.
 discard 555e0e7  Using special version from branch.
 discard 966ec7d  [MSHARED-695] - WIP - Move checksum generation from install to deploy
     add e350692  Switch to asfMavenTlpPlgnBuild
     add 9d61acb  [MDEPLOY-237] - Upgrade maven-plugins parent to version 32
     add edf6740  [MDEPLOY-238] - Upgrade JUnit 4.11 to 4.12
     add 9d34533  [MDEPLOY-239] - Add GitHub documentation
     new a88e6cb  [MSHARED-695] - WIP - Move checksum generation from install to deploy
     new 26d0cba  Using special version from branch.
     new 40ed29b  [MSHARED-695] - WIP - Move checksum generation from install to deploy  o stat of IT's. to check for checksums.
     new 8a3faae  fixup! [MSHARED-695] - WIP - Move checksum generation from install to deploy  o stat of IT's. to check for checksums.
     new eb153f2  WIP - Upgraded maven-javadoc-plugin to 3.0.1 based on NPE issue WIP - Upgraded imports etc. in code. WIP - Add TLSv 1.2 configuration for maven-invoker-plugin to JDK 7
     new 783bd1d  WIP - Upgraded release test WIP - Need to reconsider check in SNAPSHOT test       cause I can't predict the names correct.       Need to think about this (Will fail at the moment.).

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2b33b19)
            \
             N -- N -- N   refs/heads/MSHARED-695 (783bd1d)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 6 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.


Summary of changes:
 .github/pull_request_template.md | 29 ++++++++++++
 CONTRIBUTING.md                  | 91 +++++++++++++++++++++++++++++++++++++
 Jenkinsfile                      |  2 +-
 README.md                        | 97 ++++++++++++++++++++++++++++++++++++++++
 pom.xml                          |  6 +--
 5 files changed, 221 insertions(+), 4 deletions(-)
 create mode 100644 .github/pull_request_template.md
 create mode 100644 CONTRIBUTING.md
 create mode 100644 README.md


[maven-deploy-plugin] 01/06: [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 a88e6cb06ce7d64f3d195f9514d25d8d931d2793
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 a0e0788..69f642d 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


[maven-deploy-plugin] 05/06: WIP - Upgraded maven-javadoc-plugin to 3.0.1 based on NPE issue WIP - Upgraded imports etc. in code. WIP - Add TLSv 1.2 configuration for maven-invoker-plugin to JDK 7

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 eb153f2280a154cd7e0587a2b336a3b1aaee890c
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Jul 7 13:08:31 2018 +0200

    WIP - Upgraded maven-javadoc-plugin to 3.0.1 based on NPE issue
    WIP - Upgraded imports etc. in code.
    WIP - Add TLSv 1.2 configuration for maven-invoker-plugin to JDK 7
---
 pom.xml                                                           | 4 ++++
 src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java | 8 ++++----
 src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java     | 8 ++++----
 src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java | 2 +-
 .../apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java   | 4 ++--
 5 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6f0fb38..36cafaf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -189,6 +189,10 @@ under the License.
                 <goals>
                   <goal>deploy</goal>
                 </goals>
+                <properties>
+                  <!-- e.g. ensure that Java7 picks up TLSv1.2 when connecting with Central -->
+                  <https.protocols>${https.protocols}</https.protocols>
+                </properties>
               </configuration>
             </plugin>
           </plugins>
diff --git a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
index 6dd5da7..196f307 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
@@ -54,10 +54,10 @@ import org.apache.maven.project.MavenProjectHelper;
 import org.apache.maven.project.ProjectBuilder;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.maven.shared.artifact.DefaultArtifactCoordinate;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
-import org.apache.maven.shared.repository.RepositoryManager;
+import org.apache.maven.shared.transfer.artifact.DefaultArtifactCoordinate;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployer;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.shared.transfer.repository.RepositoryManager;
 import org.apache.maven.shared.utils.Os;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
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 229fd47..94b9405 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -36,10 +36,10 @@ 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;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.shared.transfer.project.NoFileAssignedException;
+import org.apache.maven.shared.transfer.project.deploy.ProjectDeployer;
+import org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest;
 
 /**
  * Deploys an artifact to remote repository.
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 9cf69eb..6a1ebff 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -40,7 +40,7 @@ import org.apache.maven.plugins.deploy.stubs.DeployArtifactStub;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.ProjectBuildingRequest;
 import org.apache.maven.repository.internal.MavenRepositorySystemSession;
-import org.apache.maven.shared.project.deploy.ProjectDeployerRequest;
+import org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest;
 import org.codehaus.plexus.util.FileUtils;
 import org.junit.Ignore;
 import org.mockito.InjectMocks;
diff --git a/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
index 9bdf48a..d0b47d4 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/stubs/ArtifactDeployerStub.java
@@ -24,8 +24,8 @@ import java.util.Collection;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.project.ProjectBuildingRequest;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployer;
-import org.apache.maven.shared.artifact.deploy.ArtifactDeployerException;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployer;
+import org.apache.maven.shared.transfer.artifact.deploy.ArtifactDeployerException;
 
 public class ArtifactDeployerStub
     implements ArtifactDeployer


[maven-deploy-plugin] 04/06: fixup! [MSHARED-695] - WIP - Move checksum generation from install to deploy o stat of IT's. to check for checksums.

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 8a3faaeb881f7e739a6fe9ea930022327c9317db
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Jul 7 12:49:03 2018 +0200

    fixup! [MSHARED-695] - WIP - Move checksum generation from install to deploy  o stat of IT's. to check for checksums.
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 642f456..6f0fb38 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.10.0.MSHARED695-SNAPSHOT</version>
+      <version>0.10.0</version>
     </dependency>
     <!-- Upgrade of transitive dependency. -->
     <dependency>


[maven-deploy-plugin] 02/06: Using special version from branch.

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 26d0cba0f81e37c36a1353d028dcb9a1008f77d4
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed May 2 17:56:42 2018 +0200

    Using special version from branch.
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 69f642d..a2dc7b3 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.2-SNAPSHOT</version>
+      <version>0.10.0.MSHARED695-SNAPSHOT</version>
     </dependency>
     <!-- Upgrade of transitive dependency. -->
     <dependency>


[maven-deploy-plugin] 06/06: WIP - Upgraded release test WIP - Need to reconsider check in SNAPSHOT test cause I can't predict the names correct. Need to think about this (Will fail at the moment.).

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 783bd1d5323e10273e32650ee2724b254b9e0b6c
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sun Jul 8 19:49:24 2018 +0200

    WIP - Upgraded release test
    WIP - Need to reconsider check in SNAPSHOT test
          cause I can't predict the names correct.
          Need to think about this (Will fail at the moment.).
---
 src/it/attach-jar-checksum-release/pom.xml        | 16 +++++++++++++++-
 src/it/attach-jar-checksum-release/verify.groovy  |  3 ++-
 src/it/attach-jar-checksum-snapshot/pom.xml       | 19 ++++++++++++++++---
 src/it/attach-jar-checksum-snapshot/verify.groovy |  7 ++-----
 4 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/src/it/attach-jar-checksum-release/pom.xml b/src/it/attach-jar-checksum-release/pom.xml
index d0e28b0..bda659d 100644
--- a/src/it/attach-jar-checksum-release/pom.xml
+++ b/src/it/attach-jar-checksum-release/pom.xml
@@ -39,7 +39,7 @@ under the License.
   <distributionManagement>
     <repository>
       <id>it</id>
-      <url>file:///${basedir}/target/repo</url>
+      <url>file:///${basedir}/target/remoterepo</url>
     </repository>
   </distributionManagement>
 
@@ -55,6 +55,20 @@ under the License.
         <artifactId>maven-deploy-plugin</artifactId>
         <version>@project.version@</version>
       </plugin>
+      <!--
+       ! This is intentionally the old version which
+       ! will not create checksums by default.
+       ! We want to make sure that only maven-deploy-plugin
+       ! will generate the checksums. 
+       -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>2.5.2</version>
+        <configuration>
+          <createChecksum>false</createChecksum>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
diff --git a/src/it/attach-jar-checksum-release/verify.groovy b/src/it/attach-jar-checksum-release/verify.groovy
index 9a7376b..ac362f8 100644
--- a/src/it/attach-jar-checksum-release/verify.groovy
+++ b/src/it/attach-jar-checksum-release/verify.groovy
@@ -44,7 +44,8 @@ def cksumToCheckPaths = [
     "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar"
 ]
 
-def repository = new File (basedir, "target/repo" )
+// Check if artifacts have been uploaded to remote with checksums
+def repository = new File (basedir, "target/remoterepo" )
 paths.each { path ->
     //File file = new File( localRepositoryPath, path );
     File file = new File( repository, path );
diff --git a/src/it/attach-jar-checksum-snapshot/pom.xml b/src/it/attach-jar-checksum-snapshot/pom.xml
index c81cc24..e43dac8 100644
--- a/src/it/attach-jar-checksum-snapshot/pom.xml
+++ b/src/it/attach-jar-checksum-snapshot/pom.xml
@@ -29,8 +29,7 @@ under the License.
   <packaging>jar</packaging>
 
   <description>
-    This test has been moved from maven-install-plugin to maven-deploy-plugin.
-    Tests the installation of a simple snapshot JAR with an attached artifact and checksums
+    Tests the installation of a simple SNAPSHOT JAR with an attached artifact and checksums
   </description>
 
   <properties>
@@ -39,7 +38,7 @@ under the License.
   <distributionManagement>
     <repository>
       <id>it</id>
-      <url>file:///${basedir}/target/repo</url>
+      <url>file:///${basedir}/target/remoterepo</url>
     </repository>
   </distributionManagement>
 
@@ -60,6 +59,20 @@ under the License.
         <artifactId>maven-jar-plugin</artifactId>
         <version>2.1</version>
       </plugin>
+      <!--
+       ! This is intentionally the old version which
+       ! will not create checksums by default.
+       ! We want to make sure that only maven-deploy-plugin
+       ! will generate the checksums. 
+       -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>2.5.2</version>
+        <configuration>
+          <createChecksum>false</createChecksum>
+        </configuration>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-resources-plugin</artifactId>
diff --git a/src/it/attach-jar-checksum-snapshot/verify.groovy b/src/it/attach-jar-checksum-snapshot/verify.groovy
index b533981..70798bd 100644
--- a/src/it/attach-jar-checksum-snapshot/verify.groovy
+++ b/src/it/attach-jar-checksum-snapshot/verify.groovy
@@ -17,9 +17,6 @@
  * under the License.
  */
 
-import java.io.*;
-import java.util.*;
-
 import org.apache.maven.plugins.deploy.Utils;
 
 def paths =
@@ -46,8 +43,8 @@ def cksumToCheckPaths = [
 
 def buildLog = new File ( basedir, "build.log")
 
-
-def repository = new File (basedir, "target/repo" )
+// Using the target/repo which is used are remote repository (deploy)
+def repository = new File (basedir, "target/remoterepo" )
 paths.each { path ->
     //File file = new File( localRepositoryPath, path );
     File file = new File( repository, path );


[maven-deploy-plugin] 03/06: [MSHARED-695] - WIP - Move checksum generation from install to deploy o stat of IT's. to check for checksums.

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 40ed29b29e7ad5f062e91738fae3fc849cebbd08
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat May 12 14:59:12 2018 +0200

    [MSHARED-695] - WIP - Move checksum generation from install to deploy
     o stat of IT's. to check for checksums.
---
 pom.xml                                            |  1 +
 src/it/attach-jar-checksum-release/pom.xml         | 89 ++++++++++++++++++++++
 src/it/attach-jar-checksum-release/setup.bsh       | 29 +++++++
 src/it/attach-jar-checksum-release/verify.groovy   | 63 +++++++++++++++
 src/it/attach-jar-checksum-snapshot/pom.xml        | 89 ++++++++++++++++++++++
 src/it/attach-jar-checksum-snapshot/setup.bsh      | 29 +++++++
 src/it/attach-jar-checksum-snapshot/verify.groovy  | 66 ++++++++++++++++
 .../org/apache/maven/plugins/deploy/Utils.java     | 64 ++++++++++++++++
 8 files changed, 430 insertions(+)

diff --git a/pom.xml b/pom.xml
index a2dc7b3..642f456 100644
--- a/pom.xml
+++ b/pom.xml
@@ -185,6 +185,7 @@ under the License.
                 <postBuildHookScript>verify</postBuildHookScript>
                 <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                 <settingsFile>src/it/settings.xml</settingsFile>
+                <addTestClassPath>true</addTestClassPath>
                 <goals>
                   <goal>deploy</goal>
                 </goals>
diff --git a/src/it/attach-jar-checksum-release/pom.xml b/src/it/attach-jar-checksum-release/pom.xml
new file mode 100644
index 0000000..d0e28b0
--- /dev/null
+++ b/src/it/attach-jar-checksum-release/pom.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.deploy.ajc</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0</version>
+  <packaging>jar</packaging>
+
+  <description>
+    This test has been moved from maven-install-plugin to maven-deploy-plugin.
+    Tests the installation of a simple snapshot JAR with an attached artifact and checksums
+  </description>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+  <distributionManagement>
+    <repository>
+      <id>it</id>
+      <url>file:///${basedir}/target/repo</url>
+    </repository>
+  </distributionManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>2.0.4</version>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3.1</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/src/it/attach-jar-checksum-release/setup.bsh b/src/it/attach-jar-checksum-release/setup.bsh
new file mode 100644
index 0000000..9c52da8
--- /dev/null
+++ b/src/it/attach-jar-checksum-release/setup.bsh
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+
+import org.codehaus.plexus.util.*;
+
+File file = new File( localRepositoryPath, "org/apache/maven/its/install/ajc" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;
diff --git a/src/it/attach-jar-checksum-release/verify.groovy b/src/it/attach-jar-checksum-release/verify.groovy
new file mode 100644
index 0000000..9a7376b
--- /dev/null
+++ b/src/it/attach-jar-checksum-release/verify.groovy
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+
+import org.apache.maven.plugins.deploy.Utils;
+
+def paths =
+[
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom.md5",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom.sha1",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar.md5",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar.sha1",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar.md5",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar.sha1",
+    "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml",
+    "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml.md5",
+    "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml.sha1",
+]
+
+def cksumToCheckPaths = [
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.pom",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0.jar",
+    "org/apache/maven/its/deploy/ajc/test/1.0/test-1.0-sources.jar"
+]
+
+def repository = new File (basedir, "target/repo" )
+paths.each { path ->
+    //File file = new File( localRepositoryPath, path );
+    File file = new File( repository, path );
+    println "Checking for existence of ${file}"
+    if ( !file.isFile() )
+    {
+        throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
+    }
+    if ( cksumToCheckPaths.contains( path ) )
+    {    
+        println "Verifying ${file}"
+        Utils.verifyChecksum( file );
+    }
+}
+
+return true;
diff --git a/src/it/attach-jar-checksum-snapshot/pom.xml b/src/it/attach-jar-checksum-snapshot/pom.xml
new file mode 100644
index 0000000..c81cc24
--- /dev/null
+++ b/src/it/attach-jar-checksum-snapshot/pom.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.deploy.ajc</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <description>
+    This test has been moved from maven-install-plugin to maven-deploy-plugin.
+    Tests the installation of a simple snapshot JAR with an attached artifact and checksums
+  </description>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+  <distributionManagement>
+    <repository>
+      <id>it</id>
+      <url>file:///${basedir}/target/repo</url>
+    </repository>
+  </distributionManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>2.0.4</version>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3.1</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/src/it/attach-jar-checksum-snapshot/setup.bsh b/src/it/attach-jar-checksum-snapshot/setup.bsh
new file mode 100644
index 0000000..9c52da8
--- /dev/null
+++ b/src/it/attach-jar-checksum-snapshot/setup.bsh
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+
+import org.codehaus.plexus.util.*;
+
+File file = new File( localRepositoryPath, "org/apache/maven/its/install/ajc" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;
diff --git a/src/it/attach-jar-checksum-snapshot/verify.groovy b/src/it/attach-jar-checksum-snapshot/verify.groovy
new file mode 100644
index 0000000..b533981
--- /dev/null
+++ b/src/it/attach-jar-checksum-snapshot/verify.groovy
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.util.*;
+
+import org.apache.maven.plugins.deploy.Utils;
+
+def paths =
+[
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.md5",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom.sha1",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar.md5",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar.sha1",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar.md5",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar.sha1",
+    "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml",
+    "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml.md5",
+    "org/apache/maven/its/deploy/ajc/test/maven-metadata.xml.sha1",
+]
+
+def cksumToCheckPaths = [
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.pom",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT.jar",
+    "org/apache/maven/its/deploy/ajc/test/1.0-SNAPSHOT/test-1.0-SNAPSHOT-sources.jar"
+]
+
+def buildLog = new File ( basedir, "build.log")
+
+
+def repository = new File (basedir, "target/repo" )
+paths.each { path ->
+    //File file = new File( localRepositoryPath, path );
+    File file = new File( repository, path );
+    println "Checking for existence of ${file}"
+    if ( !file.isFile() )
+    {
+        throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
+    }
+    if ( cksumToCheckPaths.contains( path ) )
+    {    
+        println "Verifying ${file}"
+        Utils.verifyChecksum( file );
+    }
+}
+
+return true;
diff --git a/src/test/java/org/apache/maven/plugins/deploy/Utils.java b/src/test/java/org/apache/maven/plugins/deploy/Utils.java
new file mode 100644
index 0000000..09949a6
--- /dev/null
+++ b/src/test/java/org/apache/maven/plugins/deploy/Utils.java
@@ -0,0 +1,64 @@
+package org.apache.maven.plugins.deploy;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.sonatype.aether.util.ChecksumUtils;
+
+/**
+ * A utility class to assist testing.
+ *
+ * @author Benjamin Bentmann
+ * @version $Id$
+ */
+public class Utils
+{
+
+    public static final List<String> CHECKSUM_ALGORITHMS = Arrays.asList( "MD5", "SHA-1" );
+
+    /**
+     * Verifies the checksum files in the local repo for the given file.
+     *
+     * @param file The file to verify its checksum with, must not be <code>null</code>.
+     * @throws MojoExecutionException In case the checksums were incorrect.
+     * @throws IOException If the files couldn't be read.
+     */
+    public static void verifyChecksum( File file )
+        throws MojoExecutionException, IOException
+    {
+        Map<String, Object> checksums = ChecksumUtils.calc( file, CHECKSUM_ALGORITHMS );
+        for ( Map.Entry<String, Object> entry : checksums.entrySet() )
+        {
+            File cksumFile = new File( file + "." + entry.getKey().toLowerCase().replace( "-", "" ) );
+            String actualChecksum = ChecksumUtils.read( cksumFile );
+            if ( !actualChecksum.equals( entry.getValue() ) )
+            {
+                throw new MojoExecutionException( "Incorrect " + entry.getKey() + " checksum for file: " + file );
+            }
+        }
+    }
+
+}