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