您的命令行是*:
[dependencies.sh, project-in-question.dependencies, target, third-parameter]
但在 Windows 上dependencies.sh
不是可执行文件。
要使用 cygwin 运行它,您必须像这样运行它*:
[c:\cygwin\bin\run.exe, dependencies.sh, project-in-question.dependencies, target, third-parameter]
现在我想,其他人不会乐意将 pom.xml 更改为那样。
一种可能的解决方案应该是安装“Linux 的 Windows 子系统 https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/".
另一个解决方案是创建一个 dependency.sh.bat ,其中包含以下内容:
c:\cygwin\bin\run.exe dependencies.sh %*
但使用此解决方案,您可能必须重命名计算机上的 dependency.sh ,以便 Windows 首先选择 .bat 文件。
另一个妥协可能是将执行更改为
<executable>sh</executable>
<arguments>
<argument>-c</argument>
<argument>${project.basedir}/src/main/scripts/dependencies.sh ${project.build.directory}/${project.artifactId}.dependencies ${project.build.directory} project-in-question</argument>
在你的系统上有一个 sh.batPATH
with:
c:\cygwin\bin\run.exe sh %*
*为了更好的可读性,我省略了文件夹