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

cstamas 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 22147ea  [MWRAPPER-135] Provide a reliable way to determine the Maven 
Wrapper type (#140)
22147ea is described below

commit 22147eaafb6836f4accd55a7e429363fcd6112ca
Author: Nils Breunese <n...@breun.nl>
AuthorDate: Fri May 17 21:06:28 2024 +0200

    [MWRAPPER-135] Provide a reliable way to determine the Maven Wrapper type 
(#140)
    
    Adds `distributionType` to `maven-wrapper.properties`.
    
    ---
    
    https://issues.apache.org/jira/browse/MWRAPPER-135
---
 maven-wrapper-plugin/src/it/projects/default/verify.groovy               | 1 +
 maven-wrapper-plugin/src/it/projects/mavenversion/verify.groovy          | 1 +
 maven-wrapper-plugin/src/it/projects/type_bin/verify.groovy              | 1 +
 maven-wrapper-plugin/src/it/projects/type_only-script/verify.groovy      | 1 +
 maven-wrapper-plugin/src/it/projects/type_script/verify.groovy           | 1 +
 maven-wrapper-plugin/src/it/projects/type_source/verify.groovy           | 1 +
 .../src/main/java/org/apache/maven/plugins/wrapper/WrapperMojo.java      | 1 +
 7 files changed, 7 insertions(+)

diff --git a/maven-wrapper-plugin/src/it/projects/default/verify.groovy 
b/maven-wrapper-plugin/src/it/projects/default/verify.groovy
index faf5105..6832ec6 100644
--- a/maven-wrapper-plugin/src/it/projects/default/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/default/verify.groovy
@@ -35,3 +35,4 @@ new 
File(basedir,'.mvn/wrapper/maven-wrapper.properties').withInputStream {
     props.load(it)
 }
 assert props.wrapperVersion.equals(wrapperCurrentVersion)
+assert props.distributionType.equals("only-script")
diff --git a/maven-wrapper-plugin/src/it/projects/mavenversion/verify.groovy 
b/maven-wrapper-plugin/src/it/projects/mavenversion/verify.groovy
index 730bfac..b68311e 100644
--- a/maven-wrapper-plugin/src/it/projects/mavenversion/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/mavenversion/verify.groovy
@@ -32,6 +32,7 @@ propertiesFile.withInputStream {
 }
 assert props.wrapperVersion.equals(wrapperCurrentVersion)
 assert 
props.distributionUrl.endsWith('/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip')
+assert props.distributionType.equals("only-script")
 
 log = new File(basedir, 'build.log').text
 // check "mvn wrapper:wrapper" output
diff --git a/maven-wrapper-plugin/src/it/projects/type_bin/verify.groovy 
b/maven-wrapper-plugin/src/it/projects/type_bin/verify.groovy
index 991fc24..b38cac5 100644
--- a/maven-wrapper-plugin/src/it/projects/type_bin/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/type_bin/verify.groovy
@@ -36,3 +36,4 @@ new 
File(basedir,'.mvn/wrapper/maven-wrapper.properties').withInputStream {
     props.load(it)
 }
 assert props.wrapperVersion.equals(wrapperCurrentVersion)
+assert props.distributionType.equals("bin")
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 cb38a06..c3001df 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
@@ -40,3 +40,4 @@ new 
File(basedir,'.mvn/wrapper/maven-wrapper.properties').withInputStream {
     props.load(it)
 }
 assert props.wrapperVersion.equals(wrapperCurrentVersion)
+assert props.distributionType.equals("only-script")
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 5f3e4f1..678ff51 100644
--- a/maven-wrapper-plugin/src/it/projects/type_script/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/type_script/verify.groovy
@@ -41,3 +41,4 @@ new 
File(basedir,'.mvn/wrapper/maven-wrapper.properties').withInputStream {
     props.load(it)
 }
 assert props.wrapperVersion.equals(wrapperCurrentVersion)
+assert props.distributionType.equals("script")
diff --git a/maven-wrapper-plugin/src/it/projects/type_source/verify.groovy 
b/maven-wrapper-plugin/src/it/projects/type_source/verify.groovy
index 51ecdec..603eb88 100644
--- a/maven-wrapper-plugin/src/it/projects/type_source/verify.groovy
+++ b/maven-wrapper-plugin/src/it/projects/type_source/verify.groovy
@@ -39,3 +39,4 @@ new 
File(basedir,'.mvn/wrapper/maven-wrapper.properties').withInputStream {
     props.load(it)
 }
 assert props.wrapperVersion.equals(wrapperCurrentVersion)
+assert props.distributionType.equals("source")
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 e3b7bd3..91bae30 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
@@ -288,6 +288,7 @@ public class WrapperMojo extends AbstractMojo {
         try (BufferedWriter out = 
Files.newBufferedWriter(wrapperPropertiesFile, StandardCharsets.UTF_8)) {
             out.append(String.format(Locale.ROOT, license));
             out.append("wrapperVersion=" + wrapperVersion + 
System.lineSeparator());
+            out.append("distributionType=" + distributionType + 
System.lineSeparator());
             out.append("distributionUrl=" + distributionUrl + 
System.lineSeparator());
             if (distributionSha256Sum != null) {
                 out.append("distributionSha256Sum=" + distributionSha256Sum + 
System.lineSeparator());

Reply via email to