JingGe commented on code in PR #23766:
URL: https://github.com/apache/flink/pull/23766#discussion_r1401254115


##########
mvnw:
##########
@@ -282,35 +251,58 @@ fi
 # End of extension
 
##########################################################################################
 
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-if [ "$MVNW_VERBOSE" = true ]; then
-  echo $MAVEN_PROJECTBASEDIR
+# If specified, validate the SHA-256 sum of the Maven wrapper jar file
+wrapperSha256Sum=""
+while IFS="=" read -r key value; do
+  case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
+  esac
+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
+      wrapperSha256Result=true
+    fi
+  elif command -v shasum > /dev/null; then

Review Comment:
   Afaiu, the checkcum validation works on both Linux and MacOS. Does it make 
sense to enable `wrapperSha256Sum` in the `maven-wrapper.properties` by 
default. Windows user will get error message. (NIT: maybe a specific error 
message for windows users and remove it after FLINK-33607 has been fixed.) WDYT?



-- 
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...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to