mirror of
https://git.freebsd.org/ports.git
synced 2025-06-03 20:06:29 -04:00
29 lines
607 B
Bash
29 lines
607 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
set -e
|
|
|
|
if [ -f "%%PREFIX%%/etc/maven/setenv.sh" ] ; then
|
|
. "%%PREFIX%%/etc/maven/setenv.sh"
|
|
fi
|
|
|
|
if [ -z "${M2_HOME}" ] ; then
|
|
INSTANCES_DIRECTORY="/usr/local/etc/maven-wrapper/instances.d"
|
|
INSTANCE="`%%FIND%% -s "${INSTANCES_DIRECTORY}" -type f -mindepth 1 -maxdepth 1 | %%TAIL%% -n 1`"
|
|
|
|
if [ -z "${INSTANCE}" ] ; then
|
|
echo "could not find a Maven instance! (${INSTANCES_DIRECTORY})" >&2
|
|
exit 1
|
|
fi
|
|
|
|
M2_HOME="`%%CAT%% "${INSTANCE}"`"
|
|
|
|
if [ ! -d "${M2_HOME}" ] ; then
|
|
echo "not a directory: ${M2_HOME}" >&2
|
|
exit 2
|
|
fi
|
|
fi
|
|
|
|
export M2_HOME
|
|
exec "${M2_HOME}/bin/mvn" "$@"
|