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

Croway pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit b0fdd9bbe1266e7573e0b1c98cbb40e431eb03c8
Author: Federico Mariani <[email protected]>
AuthorDate: Mon Sep 28 16:24:20 2026 +0200

    Fix Maven wrapper path in generated integration tests
---
 .../common/AbstractSpringBootBaseTestSupport.java   |  2 +-
 .../common/ArchetypeGenerationExtension.java        | 21 ++++++++++-----------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git 
a/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/AbstractSpringBootBaseTestSupport.java
 
b/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/AbstractSpringBootBaseTestSupport.java
index fd75a15ca57..b4dd6421177 100644
--- 
a/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/AbstractSpringBootBaseTestSupport.java
+++ 
b/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/AbstractSpringBootBaseTestSupport.java
@@ -78,7 +78,7 @@ public abstract class AbstractSpringBootBaseTestSupport {
         Path projectDir = archetype.getGeneratedProject().getProjectDir();
 
         List<String> command = new ArrayList<>(List.of(
-                System.getProperty("mvn-command"), "-q", "compile", 
"dependency:build-classpath",
+                ArchetypeGenerationExtension.resolveMavenCommand(), "-q", 
"compile", "dependency:build-classpath",
                 "-DincludeScope=runtime",
                 "-Dmdep.outputFile=" + CLASSPATH_FILE,
                 "-B"));
diff --git 
a/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/ArchetypeGenerationExtension.java
 
b/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/ArchetypeGenerationExtension.java
index 6b57f9b59f1..a9461b24bb0 100644
--- 
a/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/ArchetypeGenerationExtension.java
+++ 
b/tests/camel-itest-spring-boot/src/main/java/org/apache/camel/itest/springboot/common/ArchetypeGenerationExtension.java
@@ -107,18 +107,8 @@ public class ArchetypeGenerationExtension implements 
BeforeAllCallback, BeforeEa
                         + ". Run 'mvn install -pl 
archetypes/camel-archetype-spring-boot -am -DskipTests' first.");
             }
 
-            // Resolve absolute path to Maven wrapper
-            String mvnwPath = System.getProperty("mvn-command");
-            if (mvnwPath.startsWith("./")) {
-                // Convert relative path to absolute based on 
multiModuleProjectDirectory
-                String projectRoot = 
System.getProperty("maven.multiModuleProjectDirectory");
-                if (projectRoot != null) {
-                    mvnwPath = Path.of(projectRoot, 
mvnwPath.substring(2)).toString();
-                }
-            }
-
             List<String> command = new ArrayList<>(List.of(
-                    mvnwPath, "-q", "archetype:generate",
+                    resolveMavenCommand(), "-q", "archetype:generate",
                     "-B",
                     "-DarchetypeGroupId=" + ARCHETYPE_GROUP_ID,
                     "-DarchetypeArtifactId=" + ARCHETYPE_ARTIFACT_ID,
@@ -165,6 +155,15 @@ public class ArchetypeGenerationExtension implements 
BeforeAllCallback, BeforeEa
         return value;
     }
 
+    static String resolveMavenCommand() {
+        String command = requireSystemProperty("mvn-command");
+        if (command.startsWith("./")) {
+            String projectRoot = 
requireSystemProperty("maven.multiModuleProjectDirectory");
+            return Path.of(projectRoot, command.substring(2)).toString();
+        }
+        return command;
+    }
+
     private File resolveArchetypeJar(String version) {
         String localRepo = System.getProperty("maven.repo.local");
         if (localRepo == null) {

Reply via email to