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 2012/12/01 15:50:03 UTC

[32/50] git commit: MNG-5376: Account for changes between the Apple and Oracle JDKs on OSX

MNG-5376: Account for changes between the Apple and Oracle JDKs on OSX

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1412409 13f79535-47bb-0310-9956-ffa450edef68


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

Branch: refs/heads/feature/colorized-console/log4j2
Commit: 55ebcde65057cf21d549fbac91427dde6c7b33f7
Parents: a286f12
Author: Jason van Zyl <jv...@apache.org>
Authored: Thu Nov 22 02:24:16 2012 +0000
Committer: Arnaud Héritier <ah...@exoplatform.com>
Committed: Sat Dec 1 13:51:02 2012 +0100

----------------------------------------------------------------------
 apache-maven/src/bin/mvn |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/55ebcde6/apache-maven/src/bin/mvn
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 04c292f..6dd9d5e 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -54,12 +54,24 @@ case "`uname`" in
   CYGWIN*) cygwin=true ;;
   MINGW*) mingw=true;;
   Darwin*) darwin=true 
-           if [ -z "$JAVA_VERSION" ] ; then
-             JAVA_VERSION="CurrentJDK"
-           fi
-           if [ -z "$JAVA_HOME" ] ; then
-             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
+           
+           #
+           # Look for the Apple JDKs first to preserve the existing behaviour, and then look
+           # for the new JDKs provided by Oracle.
+           # 
+           if [[ -z "$JAVA_HOME" && -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ]] ; then
+             #
+             # Apple JDKs
+             #
+             JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
            fi
+             
+           if [[ -z "$JAVA_HOME" && -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ]] ; then
+               #
+               # Oracle JDKs
+               #
+               JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
+           fi           
            ;;
 esac