From cf2934b6ad821458014cc1c094e8233c10d01f75 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Tue, 13 Aug 2024 09:11:25 +0200 Subject: [PATCH] [MNG-8165] Align mvn.sh script with mvn.cmd (#1648) As one does check for .mvn directory in FS root while other does not, stops one level before. --- https://issues.apache.org/jira/browse/MNG-8165 --- apache-maven/src/assembly/shared/init | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apache-maven/src/assembly/shared/init b/apache-maven/src/assembly/shared/init index d5bd529b601c..5043c905ee31 100755 --- a/apache-maven/src/assembly/shared/init +++ b/apache-maven/src/assembly/shared/init @@ -34,11 +34,15 @@ find_maven_basedir() { ( basedir=`find_file_argument_basedir "$@"` wdir="$basedir" - while [ "$wdir" != '/' ] ; do + while : + do if [ -d "$wdir"/.mvn ] ; then basedir=$wdir break fi + if [ "$wdir" == '/' ] ; then + break + fi wdir=`cd "$wdir/.."; pwd` done echo "$basedir"