[MNG-5882] Nonportable shell constructs cause bin/mvn errors on Debian
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index e340a11..6875628 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -197,8 +197,10 @@
 # traverses directory structure from process work directory to filesystem root
 # first directory with .mvn subdirectory is considered project base directory
 find_maven_basedir() {
-  local basedir="$(pwd)"
-  local wdir="$(pwd)"
+  local basedir
+  local wdir
+  basedir="$(pwd)"
+  wdir="$(pwd)"
   while [ "$wdir" != '/' ] ; do
     if [ -d "$wdir"/.mvn ] ; then
       basedir=$wdir