|
|
@ -54,36 +54,14 @@ case "`uname`" in
|
|
|
|
CYGWIN*) cygwin=true ;;
|
|
|
|
CYGWIN*) cygwin=true ;;
|
|
|
|
MINGW*) mingw=true;;
|
|
|
|
MINGW*) mingw=true;;
|
|
|
|
Darwin*) darwin=true
|
|
|
|
Darwin*) darwin=true
|
|
|
|
#
|
|
|
|
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
|
|
|
# Look for the Apple JDKs first to preserve the existing behaviour, and then look
|
|
|
|
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
|
|
|
# for the new JDKs provided by Oracle.
|
|
|
|
if [ -z "$JAVA_HOME" ]; then
|
|
|
|
#
|
|
|
|
if [ -x "/usr/libexec/java_home" ]; then
|
|
|
|
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then
|
|
|
|
export JAVA_HOME="`/usr/libexec/java_home`"
|
|
|
|
#
|
|
|
|
else
|
|
|
|
# Apple JDKs
|
|
|
|
export JAVA_HOME="/Library/Java/Home"
|
|
|
|
#
|
|
|
|
|
|
|
|
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# Apple JDKs
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# Oracle JDKs
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# Apple JDKs
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
export JAVA_HOME=`/usr/libexec/java_home`
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
@ -184,27 +162,28 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
|
|
|
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
|
|
|
|
|
|
|
|
|
|
|
# For Cygwin, switch paths to Windows format before running java
|
|
|
|
|
|
|
|
if $cygwin; then
|
|
|
|
|
|
|
|
[ -n "$M2_HOME" ] &&
|
|
|
|
|
|
|
|
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
|
|
|
|
|
|
|
[ -n "$JAVA_HOME" ] &&
|
|
|
|
|
|
|
|
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
|
|
|
|
|
|
|
[ -n "$CLASSPATH" ] &&
|
|
|
|
|
|
|
|
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# traverses directory structure from process work directory to filesystem root
|
|
|
|
# traverses directory structure from process work directory to filesystem root
|
|
|
|
# first directory with .mvn subdirectory is considered project base directory
|
|
|
|
# first directory with .mvn subdirectory is considered project base directory
|
|
|
|
find_maven_basedir() {
|
|
|
|
find_maven_basedir() {
|
|
|
|
local basedir=$(pwd)
|
|
|
|
|
|
|
|
local wdir=$(pwd)
|
|
|
|
if [ -z "$1" ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
echo "Path not specified to find_maven_basedir"
|
|
|
|
|
|
|
|
return 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
basedir="$1"
|
|
|
|
|
|
|
|
wdir="$1"
|
|
|
|
while [ "$wdir" != '/' ] ; do
|
|
|
|
while [ "$wdir" != '/' ] ; do
|
|
|
|
if [ -d "$wdir"/.mvn ] ; then
|
|
|
|
if [ -d "$wdir"/.mvn ] ; then
|
|
|
|
basedir=$wdir
|
|
|
|
basedir=$wdir
|
|
|
|
break
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
wdir=$(cd "$wdir/.."; pwd)
|
|
|
|
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
|
|
|
|
|
|
|
if [ -d "${wdir}" ]; then
|
|
|
|
|
|
|
|
wdir=`cd "$wdir/.."; pwd`
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
# end of workaround
|
|
|
|
done
|
|
|
|
done
|
|
|
|
echo "${basedir}"
|
|
|
|
echo "${basedir}"
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -216,13 +195,26 @@ concat_lines() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
|
|
|
|
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
|
|
|
|
|
|
|
if [ -z "$BASE_DIR" ]; then
|
|
|
|
|
|
|
|
exit 1;
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
|
|
|
|
|
|
|
echo $MAVEN_PROJECTBASEDIR
|
|
|
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
|
|
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
|
|
|
|
|
|
|
|
|
|
|
# Provide a "standardized" way to retrieve the CLI args that will
|
|
|
|
# For Cygwin, switch paths to Windows format before running java
|
|
|
|
# work with both Windows and non-Windows executions.
|
|
|
|
if $cygwin; then
|
|
|
|
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
|
|
|
[ -n "$M2_HOME" ] &&
|
|
|
|
export MAVEN_CMD_LINE_ARGS
|
|
|
|
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
|
|
|
|
|
|
|
[ -n "$JAVA_HOME" ] &&
|
|
|
|
|
|
|
|
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
|
|
|
|
|
|
|
[ -n "$CLASSPATH" ] &&
|
|
|
|
|
|
|
|
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
|
|
|
|
|
|
|
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
|
|
|
|
|
|
|
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
|
|
|
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
|
|
|
|
|
|
|
|
|
|
@ -230,4 +222,4 @@ exec "$JAVACMD" \
|
|
|
|
$MAVEN_OPTS \
|
|
|
|
$MAVEN_OPTS \
|
|
|
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
|
|
|
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
|
|
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
|
|
|
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
|
|
|
${WRAPPER_LAUNCHER} "$@"
|
|
|
|
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
|
|
|