You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/08/29 19:15:23 UTC

(maven) 14/16: Fix IT: ensure mvnup is executable before forked execution

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

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

commit 7f64f4ec4e1ee285905398fc093474589598f344
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Aug 27 22:19:09 2026 +0200

    Fix IT: ensure mvnup is executable before forked execution
    
    On some CI environments, zip extraction loses Unix execute permissions
    on the mvnup script. Set it executable programmatically before running
    the forked verifier, matching how the embedded executor handles mvnenc.
    
    Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
---
 .../apache/maven/it/MavenITMvnupToolchainPluginStrategyTest.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITMvnupToolchainPluginStrategyTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITMvnupToolchainPluginStrategyTest.java
index 718b6db66d..944e6a43d8 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITMvnupToolchainPluginStrategyTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITMvnupToolchainPluginStrategyTest.java
@@ -20,6 +20,7 @@
 
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.nio.file.Paths;
 
 import org.junit.jupiter.api.Test;
 
@@ -47,6 +48,12 @@ class MavenITMvnupToolchainPluginStrategyTest extends AbstractMavenIntegrationTe
     void testMvnupAddsToolchainsPluginForOldSourceLevel() throws Exception {
         Path testDir = extractResources("mvnup-toolchain-plugin-strategy");
 
+        // Ensure mvnup script is executable (zip extraction may lose permissions on some CI environments)
+        Path mvnupBin = Paths.get(System.getProperty("maven.home"), "bin", "mvnup");
+        if (Files.exists(mvnupBin)) {
+            mvnupBin.toFile().setExecutable(true);
+        }
+
         // First run — should add the plugin
         Verifier verifier = newVerifier(testDir);
         verifier.setForkJvm(true);