aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorhq <hq@FreeBSD.org>2011-09-21 14:57:23 +0800
committerhq <hq@FreeBSD.org>2011-09-21 14:57:23 +0800
commit6e348010d54d388637de652a3f394120083a677b (patch)
treeeb60aea165728940dfeacfa8e9bc31f9fa2600cd /devel
parentf0729892e5c52bb037491763dcb8becc815b36e4 (diff)
downloadfreebsd-ports-gnome-6e348010d54d388637de652a3f394120083a677b.tar.gz
freebsd-ports-gnome-6e348010d54d388637de652a3f394120083a677b.tar.zst
freebsd-ports-gnome-6e348010d54d388637de652a3f394120083a677b.zip
The maven-wrapper provides a convenient way to switch between several Maven
installations. - By setting the M2_HOME environment variable the user can select the Maven instance to use. - A default Maven instance is selected according to the files in /usr/local/etc/maven/instances.d/
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/maven-wrapper/Makefile30
-rw-r--r--devel/maven-wrapper/files/mvn.sh.in29
-rw-r--r--devel/maven-wrapper/pkg-descr7
4 files changed, 67 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 4c86e71b06f5..2ced9fd8275f 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1006,6 +1006,7 @@
SUBDIR += make++
SUBDIR += makedepend
SUBDIR += maven-ant-tasks
+ SUBDIR += maven-wrapper
SUBDIR += maven2
SUBDIR += maven3
SUBDIR += mcpp
diff --git a/devel/maven-wrapper/Makefile b/devel/maven-wrapper/Makefile
new file mode 100644
index 000000000000..47ffedc3e25e
--- /dev/null
+++ b/devel/maven-wrapper/Makefile
@@ -0,0 +1,30 @@
+# New ports collection makefile for: maven-wrapper
+# Date created: 2011-09-19
+# Whom: Herve Quiroz <hq@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= maven-wrapper
+PORTVERSION= 1
+CATEGORIES= devel java
+MASTER_SITES= # none
+DISTFILES= # none
+
+MAINTAINER= hq@FreeBSD.org
+COMMENT= Wrapper script for the various installations of Maven
+
+NO_BUILD= yes
+SUB_FILES= mvn.sh
+SUB_LIST= CAT=${CAT} FIND=${FIND} TAIL=${TAIL}
+PLIST_FILES= bin/mvn
+PLIST_DIRSTRY= etc/maven-wrapper/instances.d etc/maven-wrapper
+
+do-fecth:
+ @${DO_NADA}
+
+do-install:
+ ${MKDIR} "${PREFIX}/etc/maven-wrapper/instances.d"
+ ${INSTALL_SCRIPT} "${WRKDIR}/mvn.sh" "${PREFIX}/bin/mvn"
+
+.include <bsd.port.mk>
diff --git a/devel/maven-wrapper/files/mvn.sh.in b/devel/maven-wrapper/files/mvn.sh.in
new file mode 100644
index 000000000000..541203dfe17a
--- /dev/null
+++ b/devel/maven-wrapper/files/mvn.sh.in
@@ -0,0 +1,29 @@
+#!/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" $@
diff --git a/devel/maven-wrapper/pkg-descr b/devel/maven-wrapper/pkg-descr
new file mode 100644
index 000000000000..a75f8cd0d9a7
--- /dev/null
+++ b/devel/maven-wrapper/pkg-descr
@@ -0,0 +1,7 @@
+The maven-wrapper provides a convenient way to switch between several Maven
+installations.
+
+- By setting the M2_HOME environment variable the user can select the Maven
+ instance to use.
+- A default Maven instance is selected according to the files in
+ /usr/local/etc/maven/instances.d/