在Cygwin shell中从Maven调用Python

在Cygwin shell中从Maven调用Python,python,maven,cygwin,Python,Maven,Cygwin,从Cygwin shell(通过Cygwin在Windows上使用bash)使用Maven进行构建时,/usr/bin的路径解析不正确 让我解释一下。Cygwin附带Python,可以通过/usr/bin的符号链接访问它。Maven应该可以访问此符号链接,因为它的位置在PATH环境变量中。Cygwin将/usr/bin添加到PATH环境变量中。然而,Maven无法找到Python。例如 [ERROR] Failed to execute goal org.codehaus.mojo:exec-m

从Cygwin shell(通过Cygwin在Windows上使用bash)使用Maven进行构建时,/usr/bin的路径解析不正确

让我解释一下。Cygwin附带Python,可以通过/usr/bin的符号链接访问它。Maven应该可以访问此符号链接,因为它的位置在PATH环境变量中。Cygwin将/usr/bin添加到PATH环境变量中。然而,Maven无法找到Python。例如

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default) on project cloud-devcloud: Command execution failed. Cannot run program "python" (in directory "C:\cygwin\home\myuser\incubator-cloudstack\tools\devcloud"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
但Python确实存在:

$ which python
/usr/bin/python
尽管是一个符号链接

$ ls -al /usr/bin/python
lrwxrwxrwx 1 donall Domain Users 13 Sep 19 11:38 /usr/bin/python -> python2.6.exe

问题是Python是一个符号链接吗?或者Maven无法访问/usr/bin中的文件?

似乎Maven是作为常规Windows本机应用程序运行的,而不是“cygwin感知应用程序”(如果存在这样的情况:-))

这由内部使用的路径表示,该路径打印在日志中:C:\cygwin\home\myuser\incubator cloudstack\tools\devcloud


因此,当定位python可执行文件时,来自Maven的调用将无法识别cygwin路径。一种可能的解决方案是将包含python.exe的目录添加到系统路径(即Windows路径变量)

是否确定?我通过符号链接复制了python26.exe,脚本运行正常。这表明这条路是好的。这是解决我在其他程序中遇到的一个相关问题的方法。我不确定Maven是如何处理这个电话的,但情况非常相似。无论如何,如果信息不准确,我道歉!