[jboss-cvs] JBossAS SVN: r85700 - in trunk: cluster and 21 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Mar 10 18:06:29 EDT 2009


Author: pgier
Date: 2009-03-10 18:06:28 -0400 (Tue, 10 Mar 2009)
New Revision: 85700

Modified:
   trunk/aspects/build.bat
   trunk/aspects/build.sh
   trunk/cluster/build.bat
   trunk/cluster/build.sh
   trunk/connector/build.bat
   trunk/connector/build.sh
   trunk/console/build.bat
   trunk/console/build.sh
   trunk/deployment/build.bat
   trunk/deployment/build.sh
   trunk/ejb3/build.bat
   trunk/ejb3/build.sh
   trunk/hibernate-int/build.bat
   trunk/hibernate-int/build.sh
   trunk/iiop/build.bat
   trunk/iiop/build.sh
   trunk/jbossas/jmx-remoting/build.bat
   trunk/jbossas/jmx-remoting/build.sh
   trunk/jbossas/remoting/build.bat
   trunk/jbossas/remoting/build.sh
   trunk/jmx-remoting/build.bat
   trunk/jmx-remoting/build.sh
   trunk/main/build.bat
   trunk/main/build.sh
   trunk/management/build.bat
   trunk/management/build.sh
   trunk/messaging/build.bat
   trunk/messaging/build.sh
   trunk/profileservice/build.bat
   trunk/profileservice/build.sh
   trunk/security/build.bat
   trunk/security/build.sh
   trunk/server/build.bat
   trunk/server/build.sh
   trunk/spring-int/build.bat
   trunk/spring-int/build.sh
   trunk/system-jmx/build.bat
   trunk/system-jmx/build.sh
   trunk/system/build.bat
   trunk/system/build.sh
   trunk/tomcat/build.bat
   trunk/tomcat/build.sh
   trunk/varia/build.bat
   trunk/varia/build.sh
   trunk/webservices/build.bat
   trunk/webservices/build.sh
Log:
[JBBUILD-515] Change the shell and bat scripts to point to the maven build.

Modified: trunk/aspects/build.bat
===================================================================
--- trunk/aspects/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/aspects/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -1,9 +1,11 @@
 @echo off
-
 REM  ======================================================================
 REM
 REM  This is the main entry point for the build system.
 REM
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
+REM  the correct version is being used with the correct configuration.
+REM
 REM  ======================================================================
 REM
 REM $Id$
@@ -14,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -24,22 +26,21 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
 REM ******************************************************
 
 SET EXECUTED=FALSE
-for %%i in (%NAMES%) do call :subLoop %%i %*
+for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
 
 goto :EOF
 
@@ -49,28 +50,17 @@
 REM ******************************************************
 
 :subLoop
-SET SUBDIR=%1
-SHIFT
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
-set OTHER_ARGS=
-:setupArgs
-if %1a==a goto doneSetupArgs
-set OTHER_ARGS=%OTHER_ARGS% %1
-shift
-goto setupArgs
-:doneSetupArgs
-
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%SUBDIR%\bin\ant.bat -logger org.apache.tools.ant.NoBannerLogger %OTHER_ARGS%
-
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
-if exist %1 call :BatchFound %*
+if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
 
 goto :EOF
 
@@ -80,7 +70,7 @@
 REM ******************************************************
 
 :BatchFound
-if (%EXECUTED%)==(FALSE) call :ExecuteBatch %*
+if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
 set EXECUTED=TRUE
 
 goto :EOF
@@ -90,9 +80,11 @@
 REM ******************************************************
 
 :ExecuteBatch
-echo Calling %*
-call %*
+echo Calling %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 
-pause
+if "%NOPAUSE%" == "" pause

Modified: trunk/aspects/build.sh
===================================================================
--- trunk/aspects/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/aspects/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-       /bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-       exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/cluster/build.bat
===================================================================
--- trunk/cluster/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/cluster/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/cluster/build.sh
===================================================================
--- trunk/cluster/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/cluster/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/connector/build.bat
===================================================================
--- trunk/connector/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/connector/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/connector/build.sh
===================================================================
--- trunk/connector/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/connector/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/console/build.bat
===================================================================
--- trunk/console/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/console/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/console/build.sh
===================================================================
--- trunk/console/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/console/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/deployment/build.bat
===================================================================
--- trunk/deployment/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/deployment/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/deployment/build.sh
===================================================================
--- trunk/deployment/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/deployment/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/ejb3/build.bat
===================================================================
--- trunk/ejb3/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/ejb3/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/ejb3/build.sh
===================================================================
--- trunk/ejb3/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/ejb3/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,40 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
-    # add some more memory
-    ANT_OPTS="$ANT_OPTS -Xmx512m"
-
-    # prevent default config beeing used
-    ANT_OPTIONS="--noconfig $ANT_OPTIONS"
-
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 
@@ -176,4 +173,3 @@
 ##
 
 main "$@"
-

Modified: trunk/hibernate-int/build.bat
===================================================================
--- trunk/hibernate-int/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/hibernate-int/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -1,9 +1,11 @@
 @echo off
-
 REM  ======================================================================
 REM
 REM  This is the main entry point for the build system.
 REM
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
+REM  the correct version is being used with the correct configuration.
+REM
 REM  ======================================================================
 REM
 REM $Id$
@@ -14,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -24,22 +26,21 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
 REM ******************************************************
 
 SET EXECUTED=FALSE
-for %%i in (%NAMES%) do call :subLoop %%i %*
+for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
 
 goto :EOF
 
@@ -49,28 +50,17 @@
 REM ******************************************************
 
 :subLoop
-SET SUBDIR=%1
-SHIFT
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
-set OTHER_ARGS=
-:setupArgs
-if %1a==a goto doneSetupArgs
-set OTHER_ARGS=%OTHER_ARGS% %1
-shift
-goto setupArgs
-:doneSetupArgs
-
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%SUBDIR%\bin\ant.bat -logger org.apache.tools.ant.NoBannerLogger %OTHER_ARGS%
-
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
-if exist %1 call :BatchFound %*
+if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
 
 goto :EOF
 
@@ -80,7 +70,7 @@
 REM ******************************************************
 
 :BatchFound
-if (%EXECUTED%)==(FALSE) call :ExecuteBatch %*
+if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
 set EXECUTED=TRUE
 
 goto :EOF
@@ -90,9 +80,11 @@
 REM ******************************************************
 
 :ExecuteBatch
-echo Calling %*
-call %*
+echo Calling %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 
-pause
+if "%NOPAUSE%" == "" pause

Modified: trunk/hibernate-int/build.sh
===================================================================
--- trunk/hibernate-int/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/hibernate-int/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/iiop/build.bat
===================================================================
--- trunk/iiop/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/iiop/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/iiop/build.sh
===================================================================
--- trunk/iiop/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/iiop/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/jbossas/jmx-remoting/build.bat
===================================================================
--- trunk/jbossas/jmx-remoting/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/jbossas/jmx-remoting/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/jbossas/jmx-remoting/build.sh
===================================================================
--- trunk/jbossas/jmx-remoting/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/jbossas/jmx-remoting/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/jbossas/remoting/build.bat
===================================================================
--- trunk/jbossas/remoting/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/jbossas/remoting/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/jbossas/remoting/build.sh
===================================================================
--- trunk/jbossas/remoting/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/jbossas/remoting/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/jmx-remoting/build.bat
===================================================================
--- trunk/jmx-remoting/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/jmx-remoting/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -1,9 +1,11 @@
 @echo off
-
 REM  ======================================================================
 REM
 REM  This is the main entry point for the build system.
 REM
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
+REM  the correct version is being used with the correct configuration.
+REM
 REM  ======================================================================
 REM
 REM $Id$
@@ -14,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -24,22 +26,21 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
 REM ******************************************************
 
 SET EXECUTED=FALSE
-for %%i in (%NAMES%) do call :subLoop %%i %*
+for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
 
 goto :EOF
 
@@ -49,28 +50,17 @@
 REM ******************************************************
 
 :subLoop
-SET SUBDIR=%1
-SHIFT
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
-set OTHER_ARGS=
-:setupArgs
-if %1a==a goto doneSetupArgs
-set OTHER_ARGS=%OTHER_ARGS% %1
-shift
-goto setupArgs
-:doneSetupArgs
-
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%SUBDIR%\bin\ant.bat -logger org.apache.tools.ant.NoBannerLogger %OTHER_ARGS%
-
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
-if exist %1 call :BatchFound %*
+if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
 
 goto :EOF
 
@@ -80,7 +70,7 @@
 REM ******************************************************
 
 :BatchFound
-if (%EXECUTED%)==(FALSE) call :ExecuteBatch %*
+if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
 set EXECUTED=TRUE
 
 goto :EOF
@@ -90,9 +80,11 @@
 REM ******************************************************
 
 :ExecuteBatch
-echo Calling %*
-call %*
+echo Calling %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 
-pause
+if "%NOPAUSE%" == "" pause

Modified: trunk/jmx-remoting/build.sh
===================================================================
--- trunk/jmx-remoting/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/jmx-remoting/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
-    # Set the max memory to 256m
-    ANT_OPTS=-Xmx256m
+    # need to specify planet57/buildmagic protocol handler package
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/main/build.bat
===================================================================
--- trunk/main/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/main/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/main/build.sh
===================================================================
--- trunk/main/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/main/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/management/build.bat
===================================================================
--- trunk/management/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/management/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/management/build.sh
===================================================================
--- trunk/management/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/management/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/messaging/build.bat
===================================================================
--- trunk/messaging/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/messaging/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/messaging/build.sh
===================================================================
--- trunk/messaging/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/messaging/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/profileservice/build.bat
===================================================================
--- trunk/profileservice/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/profileservice/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/profileservice/build.sh
===================================================================
--- trunk/profileservice/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/profileservice/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/security/build.bat
===================================================================
--- trunk/security/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/security/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/security/build.sh
===================================================================
--- trunk/security/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/security/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/server/build.bat
===================================================================
--- trunk/server/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/server/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/server/build.sh
===================================================================
--- trunk/server/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/server/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/spring-int/build.bat
===================================================================
--- trunk/spring-int/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/spring-int/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/spring-int/build.sh
===================================================================
--- trunk/spring-int/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/spring-int/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-       /bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-       exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/system/build.bat
===================================================================
--- trunk/system/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/system/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/system/build.sh
===================================================================
--- trunk/system/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/system/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/system-jmx/build.bat
===================================================================
--- trunk/system-jmx/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/system-jmx/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/system-jmx/build.sh
===================================================================
--- trunk/system-jmx/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/system-jmx/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/tomcat/build.bat
===================================================================
--- trunk/tomcat/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/tomcat/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/tomcat/build.sh
===================================================================
--- trunk/tomcat/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/tomcat/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/varia/build.bat
===================================================================
--- trunk/varia/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/varia/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
@@ -16,8 +16,8 @@
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -26,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -51,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -82,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/varia/build.sh
===================================================================
--- trunk/varia/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/varia/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,7 +3,7 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
@@ -15,21 +15,18 @@
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -76,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -112,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -134,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 

Modified: trunk/webservices/build.bat
===================================================================
--- trunk/webservices/build.bat	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/webservices/build.bat	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,19 +3,21 @@
 REM
 REM  This is the main entry point for the build system.
 REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  Users should be sure to execute this file rather than 'mvn' to ensure
 REM  the correct version is being used with the correct configuration.
 REM
 REM  ======================================================================
 REM
+REM $Id$
+REM
 REM Authors:
 REM     Jason Dillon <jason at planet57.com>
 REM     Sacha Labourey <sacha.labourey at cogito-info.ch>
 REM
 
 REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
+REM Ignore the MAVEN_HOME variable: we want to use *our*
+REM Maven version and associated JARs.
 REM ******************************************************
 REM Ignore the users classpath, cause it might mess
 REM things up
@@ -24,15 +26,14 @@
 SETLOCAL
 
 set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+set MAVEN_HOME=
 
 REM ******************************************************
 REM - "for" loops have been unrolled for compatibility
 REM   with some WIN32 systems.
 REM ******************************************************
 
-set NAMES=tools;tools\ant;tools\apache\ant
+set NAMES=tools;tools\maven;tools\apache\maven
 set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
 
 REM ******************************************************
@@ -49,13 +50,13 @@
 REM ******************************************************
 
 :subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\mvn.bat %2 %3 %4 %5 %6 %7
 
 goto :EOF
 
 
 REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
+REM ************ Test if Maven Batch file exists ***********
 REM ******************************************************
 
 :testIfExists
@@ -80,7 +81,9 @@
 
 :ExecuteBatch
 echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
+set GOAL=%2
+if "%GOAL%"=="" set GOAL=install
+call %1 %GOAL% %3 %4 %5 %6 %7 %8
 
 :end
 

Modified: trunk/webservices/build.sh
===================================================================
--- trunk/webservices/build.sh	2009-03-10 19:28:03 UTC (rev 85699)
+++ trunk/webservices/build.sh	2009-03-10 22:06:28 UTC (rev 85700)
@@ -3,31 +3,30 @@
 ##                                                                          ##
 ##  This is the main entry point for the build system.                      ##
 ##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  Users should execute this file rather than 'mvn' to ensure              ##
 ##  the correct version is being used with the correct configuration.       ##
 ##                                                                          ##
 ### ====================================================================== ###
 
+# $Id$
+
 PROGNAME=`basename $0`
 DIRNAME=`dirname $0`
 GREP="grep"
 ROOT="/"
 
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
+# Ignore user's MAVEN_HOME if it is set
+MAVEN_HOME=""
 
-# the default search path for ant
-ANT_SEARCH_PATH="\
+# the default search path for maven
+MAVEN_SEARCH_PATH="\
     tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
+    tools/maven \
+    tools/apache/maven \
+    maven"
 
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
 # the default arguments
-ANT_OPTIONS="--noconfig -find $ANT_BUILD_FILE"
+MVN_OPTIONS=""
 
 # Use the maximum available, or set MAX_FD != -1 to use that
 MAX_FD="maximum"
@@ -74,11 +73,11 @@
 search() {
     search="$*"
     for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
+	MAVEN_HOME="`pwd`/$d"
+	MVN="$MAVEN_HOME/bin/mvn"
+	if [ -x "$MVN" ]; then
 	    # found one
-	    echo $ANT_HOME
+	    echo $MAVEN_HOME
 	    break
 	fi
     done
@@ -110,17 +109,17 @@
     fi
 
     # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
+    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 
     # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
+    if [ "x$MAVEN_HOME" = "x" ]; then
 	target="build"
 	_cwd=`pwd`
 
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	while [ "x$MAVEN_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
 	    cd ..
 	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	    MAVEN_HOME=`search $MAVEN_SEARCH_PATH`
 	done
 
 	# make sure we get back
@@ -132,34 +131,40 @@
 
 	# complain if we did not find anything
 	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	    die "Could not locate Maven; check \$MVN or \$MAVEN_HOME."
 	fi
     fi
 
     # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
+    MVN=$MAVEN_HOME/bin/mvn
+    if [ ! -x "$MVN" ]; then
+	die "Maven file is not executable: $MVN"
     fi
 
     # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+    MVN_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
 
     # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+    MVN_OPTS="$MVN_OPTS -Dbuild.script=$0"
 
     # change to the directory where the script lives so users are not forced
     # to be in the same directory as build.xml
     cd $DIRNAME
 
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
+    MVN_GOAL=$@
+    if [ -z "$MVN_GOAL" ]; then
+      MVN_GOAL="install"
+    fi
+    
+    # export some stuff for maven
+    export MVN MAVEN_HOME MVN_OPTS MVN_GOAL
 
+    
     # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    if [ "x$MVN_DEBUG" != "x" ]; then
+	  /bin/sh -x $MVN $MVN_OPTIONS $MVN_GOAL
     else
-	exec $ANT $ANT_OPTIONS "$@"
+	  exec $MVN $MVN_OPTIONS $MVN_GOAL
     fi
 }
 




More information about the jboss-cvs-commits mailing list