Eclipse maven 插件:无法为 WSO2 ESB SampleServices 运行 编程 "mvn"

Eclipse maven plugin: Cannot run program "mvn" for WSO2 ESB SampleServices

如果我在 pre-packaged projectSampleServices 中通过命令行使用 mvn clean install,一切都很好。但是当我尝试通过 eclipse m2e

mvn clean install 它时,它给了我这个错误

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (package) on project SampleServices: Command execution failed. Cannot run program "mvn" (in directory "/Users/johndoe/Project/ChickenEngine/SampleServices/target/capp"): error=2, No such file or directory -> [Help 1]

我试过使用位于 /opt 的外部 maven,但仍然没有成功。我正在关注 this guide.

最后发现要多注意问题

SampleServices\pom.xml 配置 exec-maven-plugin。重要的部分是 Maven 本身被称为可执行文件

<executable>mvn</executable>
    <workingDirectory>${project.build.directory}</workingDirectory>
    <arguments>....

这意味着 mvn.bat 必须在 PATH 中。从 cmd 使用变量 PATH 或 运行 eclipse,但在应用程序启动之前执行

 set PATH=%PATH%;c:\path-to-maven-bin-directory\

只有那时

./eclipse.exe

你将进入 eclipse 控制台

    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO] 
    [INFO] QueryDoctorEP ...................................... SUCCESS [  2.855 s]
    [INFO] GrandOakEP ......................................... SUCCESS [  0.057 s]
    [INFO] ClemencyEP ......................................... SUCCESS [  0.064 s]
    [INFO] PineValleyEP ....................................... SUCCESS [  0.067 s]
    [INFO] ChannelingFeeEP .................................... SUCCESS [  0.044 s]
    [INFO] SettlePaymentEP .................................... SUCCESS [  0.051 s]
    [INFO] HealthcareAPI ...................................... SUCCESS [  0.776 s]
    [INFO] PaymentRequestMessageStore ......................... SUCCESS [  0.599 s]
    [INFO] PaymentRequestProcessingSequence ................... SUCCESS [  0.541 s]
    [INFO] PaymentRequestProcessor ............................ SUCCESS [  0.597 s]
    [INFO] SampleServices_module .............................. SUCCESS [  0.437 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 7.829 s
    [INFO] Finished at: 2017-05-23T12:23:58+03:00
    [INFO] Final Memory: 17M/209M
    [INFO] ------------------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 23.775 s
    [INFO] Finished at: 2017-05-23T12:23:58+03:00
    [INFO] Final Memory: 12M/201M
    [INFO] ------------------------------------------------------------------------