9baf7da
From abda3bfec41730810ee98e685b128f27ddc24c36 Mon Sep 17 00:00:00 2001
0960f8c
From: Michael Simacek <msimacek@redhat.com>
0960f8c
Date: Wed, 1 Feb 2017 14:54:26 +0100
9baf7da
Subject: [PATCH 1/3] Adapt mvn script
0960f8c
0960f8c
---
9baf7da
 apache-maven/src/bin/mvn | 15 +++++++++------
9baf7da
 1 file changed, 9 insertions(+), 6 deletions(-)
0960f8c
0960f8c
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
9baf7da
index a3004f917..9b118717e 100755
0960f8c
--- a/apache-maven/src/bin/mvn
0960f8c
+++ b/apache-maven/src/bin/mvn
0960f8c
@@ -22,7 +22,7 @@
0960f8c
 #
0960f8c
 # Environment Variable Prerequisites
0960f8c
 #
0960f8c
-#   JAVA_HOME       Must point at your Java Development Kit installation.
0960f8c
+#   JAVA_HOME       (Optional) Must point at your Java Development Kit installation.
9baf7da
 #   MAVEN_ARGS      (Optional) Arguments passed to Maven before CLI arguments.
0960f8c
 #   MAVEN_OPTS      (Optional) Java runtime options used when Maven is executed.
0960f8c
 #   MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
9baf7da
@@ -30,20 +30,22 @@
9baf7da
 
9baf7da
 if [ -z "$MAVEN_SKIP_RC" ] ; then
9baf7da
 
9baf7da
-  if [ -f /usr/local/etc/mavenrc ] ; then
9baf7da
-    . /usr/local/etc/mavenrc
9baf7da
-  fi
9baf7da
-
9baf7da
   if [ -f /etc/mavenrc ] ; then
0960f8c
     . /etc/mavenrc
0960f8c
   fi
0960f8c
 
8d83558
+  if [ -z "$JAVA_HOME" ] ; then
b619956
+    . /etc/java/maven@{maven_version_suffix}.conf
8d83558
+  fi
0960f8c
+
0960f8c
   if [ -f "$HOME/.mavenrc" ] ; then
0960f8c
     . "$HOME/.mavenrc"
0960f8c
   fi
0960f8c
 
0960f8c
 fi
0960f8c
 
0960f8c
+export JAVA_HOME
0960f8c
+
0960f8c
 # OS specific support. $var _must_ be set to either true or false.
0960f8c
 cygwin=false;
0960f8c
 mingw=false;
9baf7da
@@ -68,7 +70,8 @@ done
0960f8c
 
0960f8c
 saveddir=`pwd`
0960f8c
 
0960f8c
-MAVEN_HOME=`dirname "$PRG"`/..
0960f8c
+MAVEN_HOME="${_FEDORA_MAVEN_HOME:-`dirname "$PRG"`/..}"
0960f8c
+unset _FEDORA_MAVEN_HOME
0960f8c
 
0960f8c
 # make it fully qualified
0960f8c
 MAVEN_HOME=`cd "$MAVEN_HOME" && pwd`
0960f8c
-- 
9baf7da
2.39.2
0960f8c