从Git导入Maven项目到Eclipse [英] Importing a Maven project into Eclipse from Git

查看:128
本文介绍了从Git导入Maven项目到Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从Maven和Git中获得选择导入的效果,并让Eclipse正确地生成我的项目?为了让我的项目进入Eclipse,我可以选择File-> import-> maven,然后我可以导入所有的Maven项目,并且可以构建好,或者我可以选择File - > import-> git并创建一个忽略pom.xml并且不能正确生成项目的新项目。



似乎我可以做一个或另一个,但不能组合,所以我得到一个正确生成的项目。

解决方案

Eclipse Indigo + M2Eclipse 1.0使它变得非常简单。



如果您还没有安装M2Eclipse的Git连接器。 M2Eclipse将通过提示您导入菜单来帮助您。


  1. 从包资源管理器视图中选择导入...上下文菜单

  2. 选择在Maven类别下查看Maven项目选项

  3. 在所提供的窗口中选择链接在m2e Marketplace中查找更多SCM连接器

  4. 查找Git连接器...安装...重新启动

请注意,在搜索框中,您可能必须输入EGit 而不是Git找到正确的连接器。



完成后,只需转到EGit存储库,打开工作目录的上下文菜单,然后选择导入Maven项目...。



完成!


How can I get the effect of choosing to import from both Maven and Git and have Eclipse properly generate my project?

To get my project into Eclipse I can choose File->import->maven and then I get all the Maven projects imported and can build fine, or I can choose File->import->git and make a new project that ignores the pom.xml and does not generate the project properly.

It seems I can do one or the other but not combine both so I get a correctly generated project.

解决方案

Eclipse Indigo + M2Eclipse 1.0 makes it very easy.

If you don't already have the Git connector for M2Eclipse install it. M2Eclipse will help you along by prompting you on the Import menu.

  1. Select the "Import..." context menu from the Package Explorer view
  2. Select "Check out Maven projects from SCM" option under the Maven category
  3. On the window that is presented choose the link "Find more SCM connectors in the m2e Marketplace
  4. Find connector for Git...install...restart

Note that in the search box you may have to enter "EGit" instead of "Git" to find the right connector.

With that done, simply go to the EGit repository, bring up the context menu for the Working directory and select "Import Maven projects...".

Done!

这篇关于从Git导入Maven项目到Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆