a36598
From 46041685a82b861bc8616bb603e341adb740a302 Mon Sep 17 00:00:00 2001
a36598
From: Michael Simacek <msimacek@redhat.com>
a36598
Date: Wed, 1 Feb 2017 14:54:26 +0100
a36598
Subject: [PATCH 1/3] Adapt mvn script
a36598
a36598
---
a36598
 apache-maven/src/bin/mvn | 19 ++++++++++++++++---
a36598
 1 file changed, 16 insertions(+), 3 deletions(-)
a36598
a36598
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
a36598
index a554c66..818cf70 100755
a36598
--- a/apache-maven/src/bin/mvn
a36598
+++ b/apache-maven/src/bin/mvn
a36598
@@ -22,7 +22,7 @@
a36598
 #
a36598
 # Environment Variable Prerequisites
a36598
 #
a36598
-#   JAVA_HOME       Must point at your Java Development Kit installation.
a36598
+#   JAVA_HOME       (Optional) Must point at your Java Development Kit installation.
a36598
 #   MAVEN_OPTS      (Optional) Java runtime options used when Maven is executed.
a36598
 #   MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
a36598
 # -----------------------------------------------------------------------------
a36598
@@ -33,12 +33,24 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
a36598
     . /etc/mavenrc
a36598
   fi
a36598
 
a36598
+  if [ -f /etc/java/maven.conf ] ; then
a36598
+    . /etc/java/maven.conf
a36598
+  fi
a36598
+
a36598
   if [ -f "$HOME/.mavenrc" ] ; then
a36598
     . "$HOME/.mavenrc"
a36598
   fi
a36598
 
a36598
 fi
a36598
 
a36598
+if [ -f /usr/share/java-utils/java-functions ] ; then
a36598
+  . /usr/share/java-utils/java-functions
a36598
+  set_jvm
a36598
+  set_javacmd
a36598
+fi
a36598
+export JAVA_HOME
a36598
+export JAVACMD
a36598
+
a36598
 # OS specific support. $var _must_ be set to either true or false.
a36598
 cygwin=false;
a36598
 mingw=false;
a36598
@@ -63,7 +75,8 @@ done
a36598
 
a36598
 saveddir=`pwd`
a36598
 
a36598
-MAVEN_HOME=`dirname "$PRG"`/..
a36598
+MAVEN_HOME="${_FEDORA_MAVEN_HOME:-`dirname "$PRG"`/..}"
a36598
+unset _FEDORA_MAVEN_HOME
a36598
 
a36598
 # make it fully qualified
a36598
 MAVEN_HOME=`cd "$MAVEN_HOME" && pwd`
a36598
@@ -102,7 +115,7 @@ if [ ! -x "$JAVACMD" ] ; then
a36598
   exit 1
a36598
 fi
a36598
 
a36598
-CLASSWORLDS_JAR=`echo "${MAVEN_HOME}"/boot/plexus-classworlds-*.jar`
a36598
+CLASSWORLDS_JAR=`build-classpath plexus-classworlds`
a36598
 CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
a36598
 
a36598
 # For Cygwin, switch paths to Windows format before running java
a36598
-- 
a36598
2.17.1
a36598