gzm55 commented on a change in pull request #5:
URL: https://github.com/apache/maven-wrapper-plugin/pull/5#discussion_r753891730



##########
File path: maven-wrapper-distribution/src/assembly/maven/run
##########
@@ -17,3 +17,17 @@ exec "$JAVACMD" \
   "-Dlibrary.jansi.path=${MAVEN_HOME}/lib/jansi-native" \
   "-Dmaven.multiModuleProjectDirectory=$MAVEN_PROJECTBASEDIR" \
   $LAUNCHER_CLASS "$@"
+
+# read distributionUrl from 
$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties
+while IFS="=" read key value; do
+  case "$key" in (distributionUrl) distributionUrl="$value"; break ;;
+  esac
+done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
+
+# local distribution dir is distributionUrl basename without extension
+distribution=`basename $distributionUrl .zip`
+
+mvn=~/.m2/wrapper/dists/$distribution/*/bin/mvn

Review comment:
       here the glob wildcard `*` will expand to multiple files or select a 
wrong version or not expand at all in some posix shell. To invoke the main 
entrance script, u has to print the full path of the distribution or at least 
the hash of url.
   
   The cons of this method is that `java` would be run twice. While the 
original way is the java way of exec invoking.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to