search

Home  >  Q&A  >  body text

eclipse 下 maven 启动报错

maven下载之后解压,之后添加了path,
控制台执行 mvn --version 也能正常显示。

在eclipse 中 创建一个demo项目后,运行run as -> maven install 时提示如下:

-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.

从网上没找到相应的解决问题,不知各位是否遇到过此问题

刚刚测了一下,用eclipse 自带的maven好使,apache下载的不好用

怪我咯怪我咯2799 days ago646

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-04-21 11:19:25

    I found two posts on the Internet before to modify the eclipse.ini file and add
    -Dmaven.multiModuleProjectDirectory=$M2_HOME, but it didn’t work. Later, I added this paragraph to the jdk parameters and it worked

    Environment variables are configured like this

    shellexport M2_HOME=/Users/mac/Applications/maven
    export PATH=$M2_HOME/bin:$PATH 
    

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-21 11:19:25

    Check whether the environment variables are configured correctly, and whether the eclipsemavenconfiguration is correct

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-21 11:19:25

    Did you install a plug-in for eclipse?
    Have you modified the maven setting.xml warehouse path? There is also a designated place in eclipse. If it doesn’t work, try adding the environment variables when running

    reply
    0
  • PHPz

    PHPz2017-04-21 11:19:25

    The configuration is wrong. Never use the built-in maven

    reply
    0
  • Cancelreply