【发布时间】:2014-04-19 01:58:31
【问题描述】:
编辑 20140716:
tl;dr = exec-maven-plugin 不将 .cmd 文件识别为可执行脚本,但仅将 .bat 文件识别为可执行脚本。重命名 grunt.cmd --> grunt.bat、bower.cmd --> bower.bat 等作为解决方法。
在我的系统上完成npm install -g grunt-cli 之后,grunt 肯定是在PATH 上
但是,当我运行 maven install 时,这似乎没有注册。
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
(build-spa-bower) on project foobar: Command execution failed.
Cannot run program "grunt" (in directory "C:\workspace\foobar\src\main\spa"):
CreateProcess error=2, The system cannot find the file specified -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException:
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
(build-spa-bower) on project foobar: Command execution failed.
为了确定,在同一个终端中,我已经执行了这个
cd C:\workspace\foobar\src\main\spa
grunt build
...在我发出上面的 maven 命令的同一终端中,grunt 执行得很好。
exec-maven-plugin 是否使用了PATH 环境变量,或者是否需要告诉它这个可执行文件以其他方式存在?
编辑:
这个documentation 建议应该找到PATH 上的可执行文件,所以这让我更加困惑。
【问题讨论】:
标签: java node.js maven path maven-plugin