ports/devel/maven-wrapper/files/mvn.sh.in
Michael Osipov 5f0ee47286 devel/maven-wrapper: massively update port, align with devel/maven
- Submitter changes MAINTAINER to his @apache.org address
- Bump version to 2
- Use ETCDIR wherever possible
- Also install mvnDebug
- Burry long dead M2_HOME in favor of MAVEN_HOME which
  will *never* be propagated

PR: 265028, 265025
2022-07-28 17:55:11 +02:00

24 lines
528 B
Bash

#!/bin/sh
set -e
SCRIPT_NAME="$(basename $0)"
if [ -z "${MAVEN_HOME}" ] ; then
INSTANCES_DIRECTORY="%%ETCDIR%%/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 in ${INSTANCES_DIRECTORY}" >&2
exit 1
fi
MAVEN_HOME="$(%%CAT%% "${INSTANCE}")"
if [ ! -d "${MAVEN_HOME}" ] ; then
echo "Not a directory: ${MAVEN_HOME}" >&2
exit 2
fi
fi
exec "${MAVEN_HOME}/bin/${SCRIPT_NAME}" "$@"