You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Paul Michael Reilly <pm...@pajato.com> on 2006/07/02 10:28:51 UTC
Ant's "-find " functionality in Maven 2
Flush with success at finding a solution to getting Maven 2 and Emacs
to peacefully co-exist when using Emacs's compile mode, I'm now going
to go for the gold and attempt to get Maven 2 to support the
equivalent of the Ant -find option. Specifically, in Ant the -find
option will traverse (upwards) a file hierarchy looking for a named
build file. For Maven 2, the behavior I'd like is for -find to search
up for the pom.xml file. I hacked a script to do this (attached) but
it would be better to include the functionality more directly, and
less OS dependent, methinks.
-pmr
#!/bin/sh
export PATH=/usr/local/maven/bin:$PATH
dir=`pwd`
# Look for a pom.xml file using looping:
while [ "$dir" != "/" ]
do
if [ -f $dir/pom.xml ]
then
break
else
dir=`dirname $dir`
fi
done
if [ -f $dir/pom.xml ]
then
cd $dir
mvn $*
else
echo No project file found! Aborting.
fi
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org