#!/bin/sh # # $FreeBSD: head/devel/maven-wrapper/files/mvn.sh.in 340872 2014-01-24 00:14:07Z mat $ 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" "$@"