You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2013/03/14 21:04:18 UTC
[34/50] [abbrv] 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/074667f2
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/074667f2
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/074667f2
Branch: refs/heads/eclipse-aether
Commit: 074667f20fe037550263ffd64ff5064dca5b330f
Parents: b5eee08
Author: Jason van Zyl <jv...@apache.org>
Authored: Thu Nov 22 02:24:16 2012 +0000
Committer: Jason van Zyl <jv...@apache.org>
Committed: Thu Nov 22 02:24:16 2012 +0000
----------------------------------------------------------------------
apache-maven/src/bin/mvn | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/074667f2/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