Added function to switch between Maven versions. Base version taken from here: http://javaadventure.blogspot.com/2011/03/my-magic-maven-and-ant-version.html

pull/165/head
Nils Winkler 2012-10-22 13:54:00 +02:00
parent 5c0e1437d4
commit 16de378374
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
cite about-plugin
about-plugin 'maven helper functions'
usemvn ()
{
local MAVEN_INSTALL_ROOT="/usr/local"
if [ -z "$1" -o ! -x "$MAVEN_INSTALL_ROOT/apache-maven-$1/bin/mvn" ]
then
local prefix="Syntax: usemvn "
for i in $MAVEN_INSTALL_ROOT/apache-maven-*
do
if [ -x "$i/bin/mvn" ]; then
echo -n "$prefix$(basename $i | sed 's/^apache-maven-//')"
prefix=" | "
fi
done
echo ""
else
if [ -z "$MAVEN_HOME" ]
then
export PATH=$MAVEN_INSTALL_ROOT/apache-maven-$1/bin:$PATH
else
export PATH=$(echo $PATH|sed -e "s:$MAVEN_HOME/bin:$MAVEN_INSTALL_ROOT/apache-maven-$1/bin:g")
fi
export MAVEN_HOME=$MAVEN_INSTALL_ROOT/apache-maven-$1
fi
}