Eclipse maven插件:无法为WSO2 ESB SampleServices运行程序“mvn”(Eclipse maven plugin: Cannot run program “mvn” f

编程入门 行业动态 更新时间:2024-10-24 14:23:11
Eclipse maven插件:无法为WSO2 ESB SampleServices运行程序“mvn”(Eclipse maven plugin: Cannot run program “mvn” for WSO2 ESB SampleServices)

如果我通过命令行在预打包项目的 SampleServices中使用mvn clean install ,所有这一切都很好。 但是当我试图通过eclipse m2e mvn clean install它时,它给了我这个错误

无法执行目标org.codehaus.mojo:项目SampleServices上的exec-maven-plugin:1.4.0:exec(包):命令执行失败。 无法运行程序“mvn”(目录“/ Users / johndoe / Project / ChickenEngine / SampleServices / target / capp”):error = 2,没有这样的文件或目录 - > [Help 1]

我试过使用位于/opt外部maven,但仍然没有成功。 我正在遵循本指南。

All are good if I used mvn clean install via command line inside SampleServices of the pre-packaged project. But it gives me this error when I try to mvn clean install it via eclipse m2e

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]

I've tried using external maven located at /opt but still no success. I'm following this guide.

最满意答案

最终发现要更多关注问题

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

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

这意味着mvn.bat必须在PATH中。 配置或用户变量PATH或从cmd运行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] ------------------------------------------------------------------------

Eventually find out to pay more attention to problem

SampleServices\pom.xml configure exec-maven-plugin. Important part is maven itself is called as executable

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

This means that mvn.bat has to be in PATH. Configure or user variable PATH or run eclipse from cmd, but before execute

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

and only then

./eclipse.exe

and u will get in eclipse console

[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] ------------------------------------------------------------------------

更多推荐

本文发布于:2023-08-07 00:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1458431.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:插件   程序   ESB   Eclipse   maven

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!