Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing a Maven project into Eclipse from Git

Tags:

git

eclipse

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.

like image 444
Arthur Ulfeldt Avatar asked Feb 02 '11 01:02

Arthur Ulfeldt


1 Answers

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!

like image 156
Sri Sankaran Avatar answered Oct 13 '22 16:10

Sri Sankaran