Using maven outside of Eclipse

三世轮回 提交于 2020-01-03 17:01:10

问题


I am already using maven outside of eclipse, but would like to use Eclipse as my main editor. I don't want to use the maven already embedded with M2E. I want to use mine located at /usr/bin/mvn.

Under Window > Preferences, I try to add a maven installation at /usr/bin/mvn (clicking Ok does nothing; stays at the same window) and at /usr/bin (gives the error: The selected directory is not a valid Maven directory..


回答1:


Ask your maven where is Maven Home

$ mvn -V

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 14:51:28+0100)
Maven home: /home/myuser/maven

and in Eclipse add Maven Home to Maven Installation settings.

But better solution is to use Maven distribution from http://maven.apache.org/. Simply unpack this and configure in Eclipse. Maven from system distribution work great with application installed from system and is not good for development.




回答2:


/usr/bin/mvn is where the binary is placed, actual maven installation directory might be at /usr/share/maven



来源:https://stackoverflow.com/questions/16127739/using-maven-outside-of-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!