6e9424
From 247eafd819d6092661ebc57c54815acd20abd3de Mon Sep 17 00:00:00 2001
6e9424
From: Michael Simacek <msimacek@redhat.com>
6e9424
Date: Wed, 1 Feb 2017 14:54:26 +0100
6e9424
Subject: [PATCH 1/4] Adapt mvn script
6e9424
6e9424
---
6e9424
 apache-maven/src/bin/mvn | 9 +++++++--
6e9424
 1 file changed, 7 insertions(+), 2 deletions(-)
6e9424
6e9424
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
6e9424
index a554c6617..739501af4 100755
6e9424
--- a/apache-maven/src/bin/mvn
6e9424
+++ b/apache-maven/src/bin/mvn
6e9424
@@ -22,7 +22,7 @@
6e9424
 #
6e9424
 # Environment Variable Prerequisites
6e9424
 #
6e9424
-#   JAVA_HOME       Must point at your Java Development Kit installation.
6e9424
+#   JAVA_HOME       (Optional) Must point at your Java Development Kit installation.
6e9424
 #   MAVEN_OPTS      (Optional) Java runtime options used when Maven is executed.
6e9424
 #   MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
6e9424
 # -----------------------------------------------------------------------------
ea0a0d
@@ -33,12 +33,18 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
6e9424
     . /etc/mavenrc
6e9424
   fi
6e9424
 
ea0a0d
+  if [ -z "$JAVA_HOME" ] ; then
ea0a0d
+    . /etc/java/maven.conf
ea0a0d
+  fi
6e9424
+
6e9424
   if [ -f "$HOME/.mavenrc" ] ; then
6e9424
     . "$HOME/.mavenrc"
6e9424
   fi
6e9424
 
6e9424
 fi
6e9424
 
6e9424
+export JAVA_HOME
6e9424
+
6e9424
 # OS specific support. $var _must_ be set to either true or false.
6e9424
 cygwin=false;
6e9424
 mingw=false;
6e9424
@@ -63,7 +67,8 @@ done
6e9424
 
6e9424
 saveddir=`pwd`
6e9424
 
6e9424
-MAVEN_HOME=`dirname "$PRG"`/..
6e9424
+MAVEN_HOME="${_FEDORA_MAVEN_HOME:-`dirname "$PRG"`/..}"
6e9424
+unset _FEDORA_MAVEN_HOME
6e9424
 
6e9424
 # make it fully qualified
6e9424
 MAVEN_HOME=`cd "$MAVEN_HOME" && pwd`
6e9424
-- 
6e9424
2.21.0
6e9424