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