You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Zac Thompson (JIRA)" <ji...@apache.org> on 2015/05/22 20:53:17 UTC
[jira] [Updated] (MNG-5829) mvn on Solaris 10 fails with syntax
error
[ https://issues.apache.org/jira/browse/MNG-5829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zac Thompson updated MNG-5829:
------------------------------
Description:
The {{$(cmd)}} idiom is used extensively in bin/mvn from lines 199-220, but this is not supported by older incarnations of /bin/sh (used on the shebang line). The {{`cmd`}} idiom is slightly more portable, and looks like it can probably be directly substituted.
{noformat}
find_maven_basedir() {
local basedir=$(pwd)
local wdir=$(pwd)
while [ "$wdir" != '/' ] ; do
wdir=$(cd "$wdir/.."; pwd)
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
{noformat}
See MNG-5658 for an earlier case of a similar problem.
was:
The {{$(cmd)}} idiom is used extensively in bin/mvn from lines 199-220, but this is not supported by older incarnations of /bin/sh (used on the shebang line).
{noformat}
find_maven_basedir() {
local basedir=$(pwd)
local wdir=$(pwd)
while [ "$wdir" != '/' ] ; do
wdir=$(cd "$wdir/.."; pwd)
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
{noformat}
See MNG-5658 for an earlier case of a similar problem.
> mvn on Solaris 10 fails with syntax error
> -----------------------------------------
>
> Key: MNG-5829
> URL: https://issues.apache.org/jira/browse/MNG-5829
> Project: Maven
> Issue Type: Bug
> Components: Command Line
> Affects Versions: 3.3.3
> Environment: Solaris 10
> Reporter: Zac Thompson
> Priority: Minor
>
> The {{$(cmd)}} idiom is used extensively in bin/mvn from lines 199-220, but this is not supported by older incarnations of /bin/sh (used on the shebang line). The {{`cmd`}} idiom is slightly more portable, and looks like it can probably be directly substituted.
> {noformat}
> find_maven_basedir() {
> local basedir=$(pwd)
> local wdir=$(pwd)
> while [ "$wdir" != '/' ] ; do
> wdir=$(cd "$wdir/.."; pwd)
> if [ -d "$wdir"/.mvn ] ; then
> basedir=$wdir
> break
> fi
> done
> echo "${basedir}"
> }
> # concatenates all lines of a file
> concat_lines() {
> if [ -f "$1" ]; then
> echo "$(tr -s '\n' ' ' < "$1")"
> fi
> }
> export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
> MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
> {noformat}
> See MNG-5658 for an earlier case of a similar problem.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)