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