mojohaus / exec-maven-plugin

Exec Maven Plugin
https://www.mojohaus.org/exec-maven-plugin/
Apache License 2.0
163 stars 96 forks source link

git submodule status fails with exec-maven-plugin:3.1.0 but succeeds with exec-maven-plugin:1.6.0:exec #373

Open max-schaefer-dedalus opened 10 months ago

max-schaefer-dedalus commented 10 months ago

In my git hosted maven project I run exec-maven-plugin like this:

mvn -N org.codehaus.mojo:exec-maven-plugin:3.1.0:exec -Dexec.executable=git -Dexec.args="submodule status"

However, that fails with: 13:26:07 [INFO] --- exec-maven-plugin:3.1.0:exec (default-cli) @ zzzoci-1 --- 13:26:07 E:/sApps/Git-2.x/mingw64/libexec/git-core\git-submodule: line 7: basename: command not found 13:26:07 E:/sApps/Git-2.x/mingw64/libexec/git-core\git-submodule: line 7: sed: command not found 13:26:07 E:/sApps/Git-2.x/mingw64/libexec/git-core\git-submodule: line 22: .: git-sh-setup: file not found 13:26:07 [ERROR] Command execution failed. 13:26:07 org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)

But when I run the command with mvn -N org.codehaus.mojo:exec-maven-plugin:1.6.0:exec -Dexec.executable=git -Dexec.args="submodule status" it works fine.

Running git submodule status directly in cmd also works fine. Running the command using maven-antrun-plugin also works fine: ...

<target>
  <exec executable="git">
    <arg value="submodule"/>
    <arg value="status"/>
   </exec>
 </target>

I am using Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Java version: 11.0.16, vendor: Amazon.com Inc. OS name: "windows server 2022", version: "10.0", arch: "amd64", family: "windows"

slawekjaranowski commented 10 months ago

Mentioned command works on macOS ... so probably it is issue on windows os.

oschwald commented 7 months ago

We are also experiencing this on our Windows builds after upgrading from 3.0.0 to 3.1.1.