maven/0002-Adapt-mvn-script.patch
2017-02-01 15:30:16 +01:00

75 lines
2.0 KiB
Diff

From 4c12151d239f98812ac77703a0e892197387699a Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Wed, 1 Feb 2017 14:54:26 +0100
Subject: [PATCH 2/2] Adapt mvn script
---
apache-maven/src/bin/mvn | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index 6875628..3b87936 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -21,12 +21,9 @@
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
# Optional ENV vars
# -----------------
+# JAVA_HOME - location of a JDK home dir
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
@@ -40,12 +37,24 @@ if [ -z "$MAVEN_SKIP_RC" ] ; then
. /etc/mavenrc
fi
+ if [ -f /etc/java/maven.conf ] ; then
+ . /etc/java/maven.conf
+ fi
+
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
+if [ -f /usr/share/java-utils/java-functions ] ; then
+ . /usr/share/java-utils/java-functions
+ set_jvm
+ set_javacmd
+fi
+export JAVA_HOME
+export JAVACMD
+
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
@@ -111,7 +120,8 @@ if [ -z "$M2_HOME" ] ; then
saveddir=`pwd`
- M2_HOME=`dirname "$PRG"`/..
+ M2_HOME="${_FEDORA_MAVEN_HOME:-`dirname "$PRG"`/..}"
+ unset _FEDORA_MAVEN_HOME
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
@@ -238,7 +248,7 @@ export MAVEN_CMD_LINE_ARGS
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
- -classpath "${M2_HOME}"/boot/plexus-classworlds-*.jar \
+ -classpath "$(build-classpath plexus-classworlds)" \
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${CLASSWORLDS_LAUNCHER} "$@"
--
2.9.3