Skip to content

Commit

Permalink
[MWRAPPER-135] - Provide a reliable way to determine the Maven Wrappe…
Browse files Browse the repository at this point in the history
…r type
  • Loading branch information
breun committed May 17, 2024
1 parent 0e0c740 commit 29f6bc8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions maven-wrapper-plugin/src/it/projects/default/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ private void replaceProperties(String wrapperVersion, Path targetFolder) throws
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());
Expand Down

0 comments on commit 29f6bc8

Please sign in to comment.