2017-05-18 38 views
0

如果我通过命令行使用mvn clean install,那么的SampleServicespre-packaged project都可以。但它给了我这个错误,当我通过Eclipse M2E它尝试mvn clean installEclipse Maven插件:无法运行WSO2 ESB的程序“mvn”SampleServices

未能执行目标org.codehaus.mojo:EXEC-Maven的插件:1.4.0:EXEC (包)项目SampleServices:命令执行失败。不能 运行程序 “MVN”(在目录 “/用户/人johndoe /项目/ ChickenEngine/SampleServices /目标/ CAPP”): 误差= 2,没有这样的文件或目录 - > [帮助1]

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

+0

行家假设在被执行目录,其中pom.xml位于。您的消息表示无法在....../target/capp中运行程序“mvn”。目标目录由maven创建并位于basedir/target中。并且basedir是pom.xml假设位于的目录 – simar

+0

eclipse中的maven配置基本工作空间是pom.xml的位置 –

回答

0

最终找出更重视的问题

SampleServices \的pom.xml配置的exec-Maven的插件。重要的部分是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 

和u将在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] ------------------------------------------------------------------------