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

slachiewicz pushed a commit to branch fix-build
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git


The following commit(s) were added to refs/heads/fix-build by this push:
     new ce24409  Fix #322: Use forward slashes to prevent MinGW/MSYS path 
conversion
ce24409 is described below

commit ce244099287cb1b048671a52d7cc9a56398b67eb
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Mon Jun 29 23:37:47 2026 +0200

    Fix #322: Use forward slashes to prevent MinGW/MSYS path conversion
    
    Replace backslashes with forward slashes in all file paths passed to GPG
    to prevent MinGW/MSYS from misinterpreting Windows paths as relative paths
    in GitHub Actions and similar Windows build environments.
---
 src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java 
b/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java
index 5554e1b..be31a60 100644
--- a/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java
+++ b/src/main/java/org/apache/maven/plugins/gpg/GpgSigner.java
@@ -84,7 +84,7 @@ public class GpgSigner extends AbstractGpgSigner {
 
         if (homeDir != null) {
             cmd.createArg().setValue("--homedir");
-            cmd.createArg().setValue(homeDir.getAbsolutePath());
+            cmd.createArg().setValue(homeDir.getAbsolutePath().replace('\\', 
'/'));
         }
 
         if (gpgVersion.isBefore(GpgVersion.parse("2.1"))) {
@@ -176,9 +176,9 @@ public class GpgSigner extends AbstractGpgSigner {
         }
 
         cmd.createArg().setValue("--output");
-        cmd.createArg().setValue(signature.getAbsolutePath());
+        cmd.createArg().setValue(signature.getAbsolutePath().replace('\\', 
'/'));
 
-        cmd.createArg().setValue(file.getAbsolutePath());
+        cmd.createArg().setValue(file.getAbsolutePath().replace('\\', '/'));
 
         // 
----------------------------------------------------------------------------
         // Execute the command line

Reply via email to