This is an automated email from the ASF dual-hosted git repository.
bdemers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-wrapper.git
The following commit(s) were added to refs/heads/master by this push:
new d458d15 [MWRAPPER-120] Wrapper Plugin no longer add wrapperUrl
property (#114)
d458d15 is described below
commit d458d159852b8dac569d99b02c58bb4a1d5e3d18
Author: Brian Demers <[email protected]>
AuthorDate: Sun Feb 4 11:09:54 2024 -0500
[MWRAPPER-120] Wrapper Plugin no longer add wrapperUrl property (#114)
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());
}