|
|
@ -19,7 +19,7 @@
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Maven2 Start Up Batch script
|
|
|
|
# Maven Start Up Batch script
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Required ENV vars:
|
|
|
|
# Required ENV vars:
|
|
|
|
# ------------------
|
|
|
|
# ------------------
|
|
|
@ -114,7 +114,6 @@ if $mingw ; then
|
|
|
|
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
|
|
|
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
|
|
|
[ -n "$JAVA_HOME" ] &&
|
|
|
|
[ -n "$JAVA_HOME" ] &&
|
|
|
|
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
|
|
|
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
|
|
|
# TODO classpath?
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$JAVA_HOME" ]; then
|
|
|
|
if [ -z "$JAVA_HOME" ]; then
|
|
|
@ -212,7 +211,11 @@ else
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
|
|
|
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
|
|
|
|
if [ -n "$MVNW_REPOURL" ]; then
|
|
|
|
|
|
|
|
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
|
|
|
|
|
|
|
fi
|
|
|
|
while IFS="=" read key value; do
|
|
|
|
while IFS="=" read key value; do
|
|
|
|
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
|
|
|
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
@ -221,22 +224,38 @@ else
|
|
|
|
echo "Downloading from: $jarUrl"
|
|
|
|
echo "Downloading from: $jarUrl"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
|
|
|
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
|
|
|
|
|
|
|
if $cygwin; then
|
|
|
|
|
|
|
|
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if command -v wget > /dev/null; then
|
|
|
|
if command -v wget > /dev/null; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
echo "Found wget ... using wget"
|
|
|
|
echo "Found wget ... using wget"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
|
|
|
wget "$jarUrl" -O "$wrapperJarPath"
|
|
|
|
wget "$jarUrl" -O "$wrapperJarPath"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
|
|
|
|
|
|
|
fi
|
|
|
|
elif command -v curl > /dev/null; then
|
|
|
|
elif command -v curl > /dev/null; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
echo "Found curl ... using curl"
|
|
|
|
echo "Found curl ... using curl"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
curl -o "$wrapperJarPath" "$jarUrl"
|
|
|
|
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
|
|
|
|
|
|
|
curl -o "$wrapperJarPath" "$jarUrl" -f
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
echo "Falling back to using Java to download"
|
|
|
|
echo "Falling back to using Java to download"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
|
|
|
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
|
|
|
|
|
|
|
# For Cygwin, switch paths to Windows format before running javac
|
|
|
|
|
|
|
|
if $cygwin; then
|
|
|
|
|
|
|
|
javaClass=`cygpath --path --windows "$javaClass"`
|
|
|
|
|
|
|
|
fi
|
|
|
|
if [ -e "$javaClass" ]; then
|
|
|
|
if [ -e "$javaClass" ]; then
|
|
|
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
|
|
|
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
|
if [ "$MVNW_VERBOSE" = true ]; then
|
|
|
@ -277,6 +296,11 @@ if $cygwin; then
|
|
|
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
|
|
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Provide a "standardized" way to retrieve the CLI args that will
|
|
|
|
|
|
|
|
# work with both Windows and non-Windows executions.
|
|
|
|
|
|
|
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
|
|
|
|
|
|
|
export MAVEN_CMD_LINE_ARGS
|
|
|
|
|
|
|
|
|
|
|
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
|
|
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
|
|
|
|
|
|
|
|
|
|
|
exec "$JAVACMD" \
|
|
|
|
exec "$JAVACMD" \
|
|
|
|