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