如果我通过命令行在预打包项目的 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.exeand 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] ------------------------------------------------------------------------更多推荐
发布评论