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