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

bdemers pushed a commit to branch MWRAPPER-120
in repository https://gitbox.apache.org/repos/asf/maven-wrapper.git

commit 3249b16f631d85549003d137bad302336e588ab0
Author: Brian Demers <bdem...@apache.org>
AuthorDate: Tue Dec 19 18:48:46 2023 -0500

    [MWRAPPER-120]  Wrapper Plugin no longer add wrapperUrl property
    
    When using the `only-script` distribution type, the `wrapperUrl` is not 
needed, will not be added to `maven-wrapper.properties`
---
 maven-wrapper-plugin/src/it/projects/type_only-script/verify.groovy  | 5 ++++-
 maven-wrapper-plugin/src/it/projects/type_script/verify.groovy       | 5 ++++-
 .../src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java  | 4 +++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git 
a/maven-wrapper-plugin/src/it/projects/type_only-script/verify.groovy 
b/maven-wrapper-plugin/src/it/projects/type_only-script/verify.groovy
index 5625fae..97bc148 100644
--- a/maven-wrapper-plugin/src/it/projects/type_only-script/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/type_only-script/verify.groovy
@@ -22,7 +22,10 @@ assert new File(basedir,'mvnw').exists()
 assert new File(basedir,'mvnw.cmd').exists()
 assert !(new File(basedir,'mvnwDebug').exists())
 assert !(new File(basedir,'mvnwDebug.cmd').exists())
-assert new File(basedir,'.mvn/wrapper/maven-wrapper.properties').exists()
+
+wrapperProperties = new File(basedir,'.mvn/wrapper/maven-wrapper.properties')
+assert wrapperProperties.exists()
+assert !wrapperProperties.text.contains('wrapperUrl')
 
 log = new File(basedir, 'build.log').text
 // check "mvn wrapper:wrapper" output
diff --git a/maven-wrapper-plugin/src/it/projects/type_script/verify.groovy 
b/maven-wrapper-plugin/src/it/projects/type_script/verify.groovy
index 49b592b..8015b0d 100644
--- a/maven-wrapper-plugin/src/it/projects/type_script/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/type_script/verify.groovy
@@ -22,7 +22,10 @@ assert new File(basedir,'mvnw').exists()
 assert new File(basedir,'mvnw.cmd').exists()
 assert !(new File(basedir,'mvnwDebug').exists())
 assert !(new File(basedir,'mvnwDebug.cmd').exists())
-assert new File(basedir,'.mvn/wrapper/maven-wrapper.properties').exists()
+
+wrapperProperties = new File(basedir,'.mvn/wrapper/maven-wrapper.properties')
+assert wrapperProperties.exists()
+assert wrapperProperties.text.contains('wrapperUrl')
 
 log = new File(basedir, 'build.log').text
 // check "mvn wrapper:wrapper" output
diff --git 
a/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
 
b/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
index 6ac1988..76fdf78 100644
--- 
a/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
+++ 
b/maven-wrapper-plugin/src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java
@@ -297,7 +297,9 @@ public class WrapperMojo extends AbstractMojo {
             if (distributionSha256Sum != null) {
                 out.append("distributionSha256Sum=" + distributionSha256Sum + 
System.lineSeparator());
             }
-            out.append("wrapperUrl=" + wrapperUrl + System.lineSeparator());
+            if (!distributionType.equals("only-script")) {
+                out.append("wrapperUrl=" + wrapperUrl + 
System.lineSeparator());
+            }
             if (wrapperSha256Sum != null) {
                 out.append("wrapperSha256Sum=" + wrapperSha256Sum + 
System.lineSeparator());
             }

Reply via email to