You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2021/10/25 17:25:27 UTC

[maven-wrapper-plugin] branch wrapper-distribution created (now 98f9779)

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

hboutemy pushed a change to branch wrapper-distribution
in repository https://gitbox.apache.org/repos/asf/maven-wrapper-plugin.git.


      at 98f9779  unpack wrapper distribution

This branch includes the following new commits:

     new 98f9779  unpack wrapper distribution

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.


[maven-wrapper-plugin] 01/01: unpack wrapper distribution

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

hboutemy pushed a commit to branch wrapper-distribution
in repository https://gitbox.apache.org/repos/asf/maven-wrapper-plugin.git

commit 98f97798fb3bee856270e67a04e887e0461b8dc1
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Mon Oct 25 19:24:36 2021 +0200

    unpack wrapper distribution
---
 .../apache/maven/plugins/wrapper/WrapperMojo.java  | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java b/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
index 224a284..21d8601 100644
--- a/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
+++ b/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
@@ -48,7 +48,7 @@ import org.codehaus.plexus.archiver.UnArchiver;
 import org.codehaus.plexus.components.io.fileselectors.FileSelector;
 
 /**
- * Adds the maven-wrapper files to this project 
+ * Unpacks the maven-wrapper distribution files to the current project source tree. 
  * 
  * @author Robert Scholte
  * @since 3.0.0
@@ -66,7 +66,7 @@ public class WrapperMojo extends AbstractMojo
     private String mavenVersion;
 
     /**
-     * The version of the wrapper, default value is the Runtime version of Maven, should be at least 4
+     * The version of the wrapper distribution, default value is the Runtime version of Maven, should be at least 4
      */
     @Parameter( property = "wrapperVersion" )
     private String wrapperVersion;
@@ -101,11 +101,11 @@ public class WrapperMojo extends AbstractMojo
 
     // CONSTANTS
 
-    private static final String WRAPPER_GROUP_ID = "org.apache.maven";
+    private static final String WRAPPER_DISTRIBUTION_GROUP_ID = "org.apache.maven";
 
-    private static final String WRAPPER_ARTIFACT_ID = "apache-maven-wrapper";
+    private static final String WRAPPER_DISTRIBUTION_ARTIFACT_ID = "apache-maven-wrapper";
 
-    private static final String WRAPPER_EXTENSION = "zip";
+    private static final String WRAPPER_DISTRIBUTION_EXTENSION = "zip";
     
     // COMPONENTS 
     
@@ -128,7 +128,7 @@ public class WrapperMojo extends AbstractMojo
         Artifact artifact;
         try
         {
-            artifact = downloadWrapper( wrapperVersion );
+            artifact = downloadWrapperDitribution( wrapperVersion );
         }
         catch ( ArtifactResolverException e )
         {
@@ -158,18 +158,18 @@ public class WrapperMojo extends AbstractMojo
         }
     }
     
-    private Artifact downloadWrapper( String wrapperVersion )
+    private Artifact downloadWrapperDitribution( String wrapperVersion )
         throws ArtifactResolverException
     {
         ProjectBuildingRequest buildingRequest =
             new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
 
         DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate();
-        coordinate.setGroupId( WRAPPER_GROUP_ID );
-        coordinate.setArtifactId( WRAPPER_ARTIFACT_ID );
+        coordinate.setGroupId( WRAPPER_DISTRIBUTION_GROUP_ID );
+        coordinate.setArtifactId( WRAPPER_DISTRIBUTION_ARTIFACT_ID );
         coordinate.setVersion( wrapperVersion ); 
         coordinate.setClassifier( distributionType );
-        coordinate.setExtension( WRAPPER_EXTENSION );
+        coordinate.setExtension( WRAPPER_DISTRIBUTION_EXTENSION );
 
         return artifactResolver.resolveArtifact( buildingRequest, coordinate ).getArtifact();
     }
@@ -177,7 +177,7 @@ public class WrapperMojo extends AbstractMojo
     private void unpack( Artifact artifact, Path targetFolder ) throws IOException 
     {
         targetFolder = Files.createDirectories( targetFolder );
-        UnArchiver unarchiver = unarchivers.get( WRAPPER_EXTENSION );
+        UnArchiver unarchiver = unarchivers.get( WRAPPER_DISTRIBUTION_EXTENSION );
         unarchiver.setDestDirectory( targetFolder.toFile() );
         unarchiver.setSourceFile( artifact.getFile() );
         if ( !includeDebugScript )