You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ah...@apache.org on 2015/04/01 02:24:21 UTC

[39/50] [abbrv] maven git commit: mvn script is not compatible with OSX (Darwin)

mvn script is not compatible with OSX (Darwin)

Signed-off-by: Jason van Zyl <ja...@tesla.io>

closes #39


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/2f21481d
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/2f21481d
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/2f21481d

Branch: refs/heads/slf4j-log4j2
Commit: 2f21481d068ddf77d97ecf82ca962537cc6c21bb
Parents: 08715d8
Author: Arcadiy Ivanov <ar...@servicemesh.com>
Authored: Tue Mar 10 03:50:17 2015 -0400
Committer: Jason van Zyl <ja...@tesla.io>
Committed: Fri Mar 13 11:11:35 2015 -0700

----------------------------------------------------------------------
 apache-maven/src/bin/mvn | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/2f21481d/apache-maven/src/bin/mvn
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 3ceb5b6..d74125e 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -145,7 +145,12 @@ if [ -z "$JAVA_HOME" ]; then
     # readlink(1) is not available as standard on Solaris 10.
     readLink=`which readlink`
     if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
-      javaExecutable="`readlink -f \"$javaExecutable\"`"
+      if $darwin ; then
+        javaHome="`dirname \"$javaExecutable\"`"
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+      else
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
+      fi
       javaHome="`dirname \"$javaExecutable\"`"
       javaHome=`expr "$javaHome" : '\(.*\)/bin'`
       JAVA_HOME="$javaHome"