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

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

问题描述

如何获得选择从 Maven 和 Git 导入的效果并让 Eclipse 正确生成我的项目?

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

为了让我的项目进入 Eclipse,我可以选择 File->import->maven 然后我导入所有 Maven 项目并且可以正常构建,或者我可以选择 File->import->git 并创建一个新项目忽略 pom.xml 并且不会正确生成项目.

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 使它变得非常容易.

Eclipse Indigo + M2Eclipse 1.0 makes it very easy.

如果您还没有用于 M2Eclipse 的 Git 连接器,请安装它.M2Eclipse 将通过在导入菜单上提示您来帮助您.

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. 从包资源管理器视图中选择导入..."上下文菜单
  2. 在 Maven 类别下选择Check out Maven projects from SCM"选项
  3. 在出现的窗口中,选择链接在 m2e 市场中查找更多 SCM 连接器
  4. 查找 Git 连接器...安装...重新启动

请注意,您可能需要在搜索框中输入EGit"而不是Git"才能找到正确的连接器.

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

完成后,只需转到 EGit 存储库,调出工作目录的上下文菜单并选择导入 Maven 项目...".

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

完成!

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

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