raphw commented on code in PR #58:
URL: https://github.com/apache/maven-wrapper/pull/58#discussion_r936529321


##########
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:
   Indeed, I chose it as it ships with most Linux distributions and is 
available on Mac which *sha256sum* is not. I added a switch on the command's 
availability.



-- 
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

Reply via email to