97d2f001c1
svn cp from devel/maven33 Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. WWW: http://maven.apache.org/ Add CONFLICTS_INSTALL for devel/maven3, devel/maven31, devel/maven33[1] PR: 220959 Submitted by: jonc@chen.org.nz Approved by: [1] portmgr blanket
46 lines
1.1 KiB
Bash
46 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
|
|
if [ -f /etc/mavenrc ] ; then
|
|
. /etc/mavenrc
|
|
fi
|
|
|
|
if [ -f "${HOME}/.mavenrc" ] ; then
|
|
. "${HOME}/.mavenrc"
|
|
fi
|
|
|
|
M2_HOME=${M2_HOME:-"%%DATADIR%%"}
|
|
|
|
# traverses directory structure from process work directory to filesystem root
|
|
# first directory with .mvn subdirectory is considered project base directory
|
|
find_maven_basedir()
|
|
{
|
|
local basedir=$(pwd)
|
|
local wdir=$(pwd)
|
|
while [ "$wdir" != '/' ] ; do
|
|
wdir=$(cd "$wdir/.."; pwd)
|
|
if [ -d "$wdir"/.mvn ] ; then
|
|
basedir=$wdir
|
|
break
|
|
fi
|
|
done
|
|
echo "${basedir}"
|
|
}
|
|
|
|
# concatenates all lines of a file
|
|
concat_lines()
|
|
{
|
|
if [ -f "$1" ]; then
|
|
echo "$(tr -s '\n' ' ' < "$1")"
|
|
fi
|
|
}
|
|
|
|
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
|
|
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
|
|
|
JAVA_VERSION="%%JAVA_VERSION%%" exec "%%LOCALBASE%%/bin/java" $MAVEN_OPTS \
|
|
-classpath "${M2_HOME}/boot/%%CLASSWORLDS_JAR%%" \
|
|
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
|
|
"-Dmaven.home=${M2_HOME}" \
|
|
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
|
org.codehaus.classworlds.Launcher "$@"
|