3bca76
From 46041685a82b861bc8616bb603e341adb740a302 Mon Sep 17 00:00:00 2001
3bca76
From: Michael Simacek <msimacek@redhat.com>
3bca76
Date: Wed, 1 Feb 2017 14:54:26 +0100
3bca76
Subject: [PATCH 1/3] Adapt mvn script
3bca76
3bca76
---
3bca76
 apache-maven/src/bin/mvn | 19 ++++++++++++++++---
3bca76
 1 file changed, 16 insertions(+), 3 deletions(-)
3bca76
3bca76
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
3bca76
index a554c66..818cf70 100755
3bca76
--- a/apache-maven/src/bin/mvn
3bca76
+++ b/apache-maven/src/bin/mvn
3bca76
@@ -22,7 +22,7 @@
3bca76
 #
3bca76
 # Environment Variable Prerequisites
3bca76
 #
3bca76
-#   JAVA_HOME       Must point at your Java Development Kit installation.
3bca76
+#   JAVA_HOME       (Optional) Must point at your Java Development Kit installation.
3bca76
 #   MAVEN_OPTS      (Optional) Java runtime options used when Maven is executed.
3bca76
 #   MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
3bca76
 # -----------------------------------------------------------------------------
3bca76
@@ -33,12 +33,24 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
3bca76
     . /etc/mavenrc
3bca76
   fi
3bca76
 
3bca76
+  if [ -f /etc/java/maven.conf ] ; then
3bca76
+    . /etc/java/maven.conf
3bca76
+  fi
3bca76
+
3bca76
   if [ -f "$HOME/.mavenrc" ] ; then
3bca76
     . "$HOME/.mavenrc"
3bca76
   fi
3bca76
 
3bca76
 fi
3bca76
 
3bca76
+if [ -f /usr/share/java-utils/java-functions ] ; then
3bca76
+  . /usr/share/java-utils/java-functions
3bca76
+  set_jvm
3bca76
+  set_javacmd
3bca76
+fi
3bca76
+export JAVA_HOME
3bca76
+export JAVACMD
3bca76
+
3bca76
 # OS specific support. $var _must_ be set to either true or false.
3bca76
 cygwin=false;
3bca76
 mingw=false;
3bca76
@@ -63,7 +75,8 @@ done
3bca76
 
3bca76
 saveddir=`pwd`
3bca76
 
3bca76
-MAVEN_HOME=`dirname "$PRG"`/..
3bca76
+MAVEN_HOME="${_FEDORA_MAVEN_HOME:-`dirname "$PRG"`/..}"
3bca76
+unset _FEDORA_MAVEN_HOME
3bca76
 
3bca76
 # make it fully qualified
3bca76
 MAVEN_HOME=`cd "$MAVEN_HOME" && pwd`
3bca76
@@ -102,7 +115,7 @@ if [ ! -x "$JAVACMD" ] ; then
3bca76
   exit 1
3bca76
 fi
3bca76
 
3bca76
-CLASSWORLDS_JAR=`echo "${MAVEN_HOME}"/boot/plexus-classworlds-*.jar`
3bca76
+CLASSWORLDS_JAR=`build-classpath plexus-classworlds`
3bca76
 CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
3bca76
 
3bca76
 # For Cygwin, switch paths to Windows format before running java
3bca76
-- 
3bca76
2.17.1
3bca76