[MNG-5829] mvn shell script fails with syntax error on Solaris 10

Use backticks instead of $(..) for the scripting added in MNG-5767.
Solaris's /bin/sh isn't POSIX-compliant enough to recognise the first
form.

This closes #50.
This commit is contained in:
Joseph Walton 2017-01-30 11:01:49 +01:00 committed by Michael Osipov
parent 8c7ce55572
commit 1d9708a954
3 changed files with 8 additions and 8 deletions

View File

@ -192,14 +192,14 @@ fi
find_maven_basedir() {
local basedir
local wdir
basedir="$(pwd)"
wdir="$(pwd)"
basedir="`pwd`"
wdir="`pwd`"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
wdir="$(cd "$wdir/.."; pwd)"
wdir="`cd "$wdir/.."; pwd`"
done
echo "${basedir}"
}
@ -207,12 +207,12 @@ find_maven_basedir() {
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
echo "`tr -s '\n' ' ' < "$1"`"
fi
}
MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-$(find_maven_basedir)}"
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir`}"
MAVEN_OPTS="`concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"` $MAVEN_OPTS"
# For Cygwin, switch project base directory path to Windows format before
# executing Maven otherwise this will cause Maven not to consider it.

View File

@ -31,4 +31,4 @@ MAVEN_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,addre
echo Preparing to execute Maven in debug mode
env MAVEN_OPTS="$MAVEN_OPTS" MAVEN_DEBUG_OPTS="$MAVEN_DEBUG_OPTS" "$(dirname "$0")/mvn" "$@"
env MAVEN_OPTS="$MAVEN_OPTS" MAVEN_DEBUG_OPTS="$MAVEN_DEBUG_OPTS" "`dirname "$0"`/mvn" "$@"

View File

@ -32,4 +32,4 @@ if [ ! -f "$YJPLIB" ]; then
exit 1
fi
env MAVEN_OPTS="-agentpath:$YJPLIB=onexit=snapshot,onexit=memory,tracing,onlylocal $MAVEN_OPTS" "$(dirname "$0")/mvn" "$@"
env MAVEN_OPTS="-agentpath:$YJPLIB=onexit=snapshot,onexit=memory,tracing,onlylocal $MAVEN_OPTS" "`dirname "$0"`/mvn" "$@"