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 2019/03/14 21:29:20 UTC

[maven-deploy-plugin] branch MDEPLOY-244 updated (665fb99 -> 5ae22c9)

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

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


 discard 665fb99  [MDEPLOY-244] - maven deploy plugin 3.0.0-M1 breaks RPM deploys
     add 3f279e4  [MDEPLOY-249] fixed javadoc: format has no layout part now
     add a00bd19  [MDEPLOY-249] fixed javadoc: format has no layout part now
     add c34d0b5  [MDEPOY-250] document network issues workaround found by PLC4X
     add 7057a02  fixed date format for Doxia parsing
     add 539fcc7  [MDEPLOY-245] - Remove the remnants of the obsolete `updateReleaseInfo` parameter.
     add 4b1a992  [MDEPLOY-247] - Version 3.0.0-M1 breaks deploy using alt*DeploymentRepository with old syntax on Windows  - Enhanced docs
     add 790b563  [MDEPLOY-248] - Update maven-artifact-transfer from 0.10.0 to 0.11.0
     new 5ae22c9  [MDEPLOY-244] - maven deploy plugin 3.0.0-M1 breaks RPM deploys

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   (665fb99)
            \
             N -- N -- N   refs/heads/MDEPLOY-244 (5ae22c9)

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


Summary of changes:
 pom.xml                                            |   2 +-
 src/it/3rd-party-jar-with-extras/test.properties   |   1 -
 src/it/3rd-party-jar-without-pom/test.properties   |   1 -
 src/it/3rd-party-pom-with-extras/test.properties   |   1 -
 src/it/attach-release-jar/pom.xml                  |   1 -
 src/it/external-release-jar/test.properties        |   1 -
 src/it/release-jar/pom.xml                         |   1 -
 src/it/release-pom/pom.xml                         |   1 -
 .../apache/maven/plugins/deploy/DeployMojo.java    |  14 ++-
 src/site/apt/examples/deploy-ftp.apt               |   2 +-
 src/site/apt/examples/deploy-network-issues.apt    | 123 +++++++++++++++++++++
 src/site/apt/examples/deploy-ssh-external.apt      |   2 +-
 .../apt/examples/deploying-in-legacy-layout.apt.vm |   2 +-
 .../apt/examples/deploying-sources-javadoc.apt.vm  |   2 +-
 .../apt/examples/deploying-with-classifiers.apt.vm |   2 +-
 .../examples/deploying-with-customed-pom.apt.vm    |   2 +-
 src/site/apt/examples/disabling-generic-pom.apt.vm |   2 +-
 src/site/apt/file-deployment.apt                   |   2 +-
 src/site/apt/index.apt.vm                          |  15 +--
 src/site/apt/project-deployment.apt                |   4 +-
 src/site/apt/usage.apt                             |   2 +-
 21 files changed, 155 insertions(+), 28 deletions(-)
 create mode 100644 src/site/apt/examples/deploy-network-issues.apt


[maven-deploy-plugin] 01/01: [MDEPLOY-244] - maven deploy plugin 3.0.0-M1 breaks RPM deploys

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

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

commit 5ae22c929e6f6fa63a2c03e59989b70c636b6989
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Oct 13 13:05:55 2018 +0200

    [MDEPLOY-244] - maven deploy plugin 3.0.0-M1 breaks RPM deploys
---
 .../apache/maven/plugins/deploy/DeployMojo.java    | 26 +++++++++++++------
 src/site/apt/index.apt.vm                          |  2 +-
 .../maven/plugins/deploy/DeployMojoTest.java       | 29 ++++++++++++++++++++++
 3 files changed, 48 insertions(+), 9 deletions(-)

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 5953d6e..084c411 100644
--- a/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
+++ b/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
@@ -55,6 +55,8 @@ public class DeployMojo
 
     private static final Pattern ALT_REPO_SYNTAX_PATTERN = Pattern.compile( "(.+)::(.+)" );
 
+    private static final Pattern OLD_ALT_REPO_SYNTAX_PATTERN = Pattern.compile( "(.+)::(.+)::(.+)" );
+
     /**
      * When building with multiple threads, reaching the last project doesn't have to mean that all projects are ready
      * to be deployed
@@ -85,7 +87,6 @@ public class DeployMojo
     /**
      * Specifies an alternative repository to which the project artifacts should be deployed ( other than those
      * specified in &lt;distributionManagement&gt; ). <br/>
-     * Format: <code>id::url</code>
      * <dl>
      * <dt>id</dt>
      * <dd>The id can be used to pick up the correct credentials from the settings.xml</dd>
@@ -240,20 +241,24 @@ public class DeployMojo
         {
             getLog().info( "Using alternate deployment repository " + altDeploymentRepo );
 
-            Matcher matcher = ALT_REPO_SYNTAX_PATTERN.matcher( altDeploymentRepo );
+            if ( matchesOldSyntax( altDeploymentRepo ) )
+            {
+                throw new MojoFailureException( altDeploymentRepo,
+                                                "The syntax for the alternative repository has been changed.",
+                                                "Please use \"id::url\" instead of \"id::layout::url\"." );
+            }
 
+            Matcher matcher = ALT_REPO_SYNTAX_PATTERN.matcher( altDeploymentRepo );
             if ( !matcher.matches() )
             {
                 throw new MojoFailureException( altDeploymentRepo, "Invalid syntax for repository.",
                                                 "Invalid syntax for alternative repository. Use \"id::url\"." );
             }
-            else
-            {
-                String id = matcher.group( 1 ).trim();
-                String url = matcher.group( 2 ).trim();
 
-                repo = createDeploymentArtifactRepository( id, url );
-            }
+            String id = matcher.group( 1 ).trim();
+            String url = matcher.group( 2 ).trim();
+
+            repo = createDeploymentArtifactRepository( id, url );
         }
 
         if ( repo == null )
@@ -272,4 +277,9 @@ public class DeployMojo
         return repo;
     }
 
+    private boolean matchesOldSyntax( String repo )
+    {
+        return OLD_ALT_REPO_SYNTAX_PATTERN.matcher( repo ).matches();
+    }
+
 }
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
index a23f6a0..2616c71 100644
--- a/src/site/apt/index.apt.vm
+++ b/src/site/apt/index.apt.vm
@@ -92,7 +92,7 @@ ${project.name}
 
   []
 
-  As of Maven 3, snapshot artifacts will always be deployed using a timestamped version.
+  As of Maven 3, snapshot artifacts will always be deployed using a time stamped version.
 
 * Usage
 
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 6c6f938..50dc2dc 100644
--- a/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
+++ b/src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
@@ -32,6 +32,7 @@ import java.util.Properties;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
 import org.apache.maven.plugins.deploy.stubs.ArtifactDeployerStub;
@@ -43,6 +44,7 @@ import org.apache.maven.repository.internal.MavenRepositorySystemSession;
 import org.apache.maven.shared.transfer.project.deploy.ProjectDeployerRequest;
 import org.codehaus.plexus.util.FileUtils;
 import org.junit.Ignore;
+import org.junit.Test;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
@@ -589,7 +591,34 @@ public class DeployMojoTest
         assertEquals( repository,
                       mojo.getDeploymentRepository( pdr ));
     }
+
+
     
+    public void testWrongOldRepositoryformatForDeploymentRepository()
+        throws MojoExecutionException, MojoFailureException
+    {
+        DeployMojo mojo = spy( new DeployMojo() );
+
+        ArtifactRepository repository = mock( ArtifactRepository.class );
+        when( mojo.createDeploymentArtifactRepository( "altReleaseDeploymentRepository",
+                                                       "http://localhost" ) ).thenReturn( repository );
+
+        project.setVersion( "1.0" );
+
+        ProjectDeployerRequest pdr =
+            new ProjectDeployerRequest().setProject( project ).setAltDeploymentRepository( "altDeploymentRepository::layout::http://localhost" );
+
+        try
+        {
+            mojo.getDeploymentRepository( pdr );
+            fail( "We have expected an MojoFailureException" );
+        }
+        catch ( MojoFailureException e )
+        {
+            // Intentionally empty.
+        }
+    }
+
     private void addFileToList( File file, List<String> fileList )
     {
         if( !file.isDirectory() )