This is an automated email from the ASF dual-hosted git repository.

timoninmaxim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 77effbff657 IGNITE-23452 ignite-compatibility module use ./mvnw script 
(#11603)
77effbff657 is described below

commit 77effbff6574d75cec7d246a5f1023b604c5d72a
Author: Popov Aleksandr <[email protected]>
AuthorDate: Mon Oct 21 15:24:13 2024 +0300

    IGNITE-23452 ignite-compatibility module use ./mvnw script (#11603)
---
 .../compatibility/testframework/util/MavenUtils.java    | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java
 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java
index 909c49c55f7..aa3ef465b58 100644
--- 
a/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java
+++ 
b/modules/compatibility/src/test/java/org/apache/ignite/compatibility/testframework/util/MavenUtils.java
@@ -268,9 +268,20 @@ public class MavenUtils {
         if (m2Home == null)
             m2Home = System.getProperty("M2_HOME");
 
-        if (m2Home == null)
-            return "mvn";
+        if (m2Home != null)
+            return m2Home + "/bin/mvn";
+
+        File curDir = new File(System.getProperty("user.dir"));
+
+        while (curDir != null) {
+            Path mvnwPath = Paths.get(curDir.getAbsolutePath(), "mvnw");
+
+            if (Files.exists(mvnwPath) && Files.isExecutable(mvnwPath))
+                return mvnwPath.toString();
+
+            curDir = curDir.getParentFile();
+        }
 
-        return m2Home + "/bin/mvn";
+        return "mvn";
     }
 }

Reply via email to