Maven project and Eclipse workspace

那年仲夏 提交于 2020-03-24 06:19:25

问题


I have been working with Netbeans quite a while and I am now moving to Eclipse.

Basically I have a Maven project that I would like to work on using Eclipse.

What I am not sure about is whether I need to point my Eclipse workspace to the directory where my project super pom is located or whether the Eclipse workspace needs to point to a clean/empty directory.

My question is basically:

  • Are the source files eventually located in the Eclipse workspace directory?

Can anyone please advise?

Regards,


回答1:


If you have the m2e or m2eclipse plugin installed, you can just do "Import..." then "Existing Maven Projects" and point it at the super-pom. It'll import all the modules it finds, as separate projects.




回答2:


you can use the maven eclipse target to generate project files so you can move them directly in the eclipse workspace:

mvn eclipse:eclipse

info on the plugin




回答3:


It's a matter of personal preference whether you have the source files in the workspace folder or not. Eclipse can import your project from any folder. Personnaly, I keep my projects folder separated from the workspace folder.



来源:https://stackoverflow.com/questions/8852989/maven-project-and-eclipse-workspace

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