From 1a9e50ef0efa014a7da3c9bb2218bf48a1346d01 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Thu, 19 Sep 2024 10:57:21 -0400 Subject: [PATCH] [MWRAPPER-150] - Fails to validate checksums on MacOS Sequoia The version of `sha256sum` included in macOS Sequoia does not read from stdin by default --- maven-wrapper-distribution/src/resources/mvnw | 2 +- maven-wrapper-distribution/src/resources/only-mvnw | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 maven-wrapper-distribution/src/resources/mvnw diff --git a/maven-wrapper-distribution/src/resources/mvnw b/maven-wrapper-distribution/src/resources/mvnw old mode 100644 new mode 100755 index 5272759..4b65449 --- a/maven-wrapper-distribution/src/resources/mvnw +++ b/maven-wrapper-distribution/src/resources/mvnw @@ -284,7 +284,7 @@ done <"$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" if [ -n "$wrapperSha256Sum" ]; then wrapperSha256Result=false if command -v sha256sum >/dev/null; then - if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c >/dev/null 2>&1; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c - >/dev/null 2>&1; then wrapperSha256Result=true fi elif command -v shasum >/dev/null; then diff --git a/maven-wrapper-distribution/src/resources/only-mvnw b/maven-wrapper-distribution/src/resources/only-mvnw index 02b2e72..21c1f01 100755 --- a/maven-wrapper-distribution/src/resources/only-mvnw +++ b/maven-wrapper-distribution/src/resources/only-mvnw @@ -227,7 +227,7 @@ if [ -n "${distributionSha256Sum-}" ]; then echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 exit 1 elif command -v sha256sum >/dev/null; then - if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then distributionSha256Result=true fi elif command -v shasum >/dev/null; then