Fix while loop so that basedir is detected in current dir

There was a problem with the logic in the while loop that detects
the base dir - it should first look in the current directory,
otherwise you can't build in a directory with local settings because
it will always climb up and find .mvn in a parent directory (e.g. user's
home).
This commit is contained in:
Dave Syer 2015-07-16 12:07:00 +01:00 committed by rfscholte
parent a1b3a7b589
commit cbb5886a8e
1 changed files with 1 additions and 1 deletions

2
maven-wrapper/mvnw vendored
View File

@ -200,11 +200,11 @@ find_maven_basedir() {
local basedir=$(pwd)
local wdir=$(pwd)
while [ "$wdir" != '/' ] ; do
wdir=$(cd "$wdir/.."; pwd)
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
wdir=$(cd "$wdir/.."; pwd)
done
echo "${basedir}"
}