Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

#!/bin/bash
# Helper functions
find_maven_basedir() {
local basedir
local wdir
basedir="$(pwd)"
wdir="$(pwd)"
while [ "$wdir" != '/' ]; do
if [ -d "$wdir"/.mvn ]; then
basedir=$wdir
break
fi
wdir="$(cd "$wdir/.."; pwd)"
done
echo "${basedir}"
}
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}
# Look for RC files in XDG directories
for dir in $(echo ${XDG_CONFIG_DIRS:-/etc/xdg} | tr ':' ' ') ${XDG_CONFIG_HOME:-$HOME/.config} ; do
if [ -f $dir/maven/maven.rc ]; then
. $dir/maven/maven.rc
fi
done
MAVEN_PROJECTBASEDIR="${MAVEN_PROJECTBASEDIR:-$(find_maven_basedir)}"
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
export MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
exec java \
$MAVEN_OPTS $MAVEN_DEBUG_OPTS \
-classpath /usr/lib/apache-maven/boot/plexus-classworlds-*.jar \
-Dclassworlds.conf=/usr/lib/apache-maven/bin/m2.conf \
-Dmaven.home=/usr/lib/apache-maven \
-Dlibrary.jansi.path=/usr/lib/apache-maven/lib/jansi-native \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
org.codehaus.plexus.classworlds.launcher.Launcher \
"$@"