jorsol commented on code in PR #58: URL: https://github.com/apache/maven-wrapper/pull/58#discussion_r936495287
########## maven-wrapper-distribution/src/resources/mvnw: ########## @@ -247,6 +247,25 @@ fi # End of extension ########################################################################################## +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + if ! command -v shasum > /dev/null; then + echo "Checksum validation was requested but the 'shasum' command is not available in the current environment." + echo "Please install 'shasum' or disable validation by removing 'wrapperSha256Sum' from your maven.properties file." Review Comment: On Linux the `shasum` is a Perl package, so it might not be a good idea depending on this command. To allow for more compatibility is better to test for the existence of the coreutils version `sha256sum` first, and if not found, fallback to `shasum` (which I doubt will exist on normal installations), not sure if it's the opposite on Mac or others OS, yet on Linux, the `sha256sum` command is the way to go. Also, the file is maven-wrapper.properties, not maven.properties -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org