hboutemy commented on a change in pull request #5:
URL: https://github.com/apache/maven-wrapper-plugin/pull/5#discussion_r756611915
##########
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:
to remove `*`, in Unix shell, I suppose we can derive directory name
from with `basename $distribution -bin`
I'm not too much worried in POSIX shell: equivalent implementation in
Windows cmd is harder to me
on running java twice, I suppose the script can check if the distribution is
already installed to not run the installation `java -jar maven-wrapper.jar` if
not really necessary
--
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]