Importing a Maven project into Eclipse from Git Importing a Maven project into Eclipse from Git git git

Importing a Maven project into Eclipse from Git


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!


I would perform a git clone via the command line (outside Eclipse) then use File -> Import... -> Existing Maven Projects.

Your projects will be understood as using Git and Maven. It's the fastest and most reliable way to import IMO.



Step 1 : Setting Up Eclipse

First of all you'll need to have a few Eclipse plug-ins installed. So use eclipse IDE software install feature in the help dropdown menu → Install new software, and add link to Available Software Site, then install it.

  1. GIT plugin (EGIT)- http://download.eclipse.org/egit/updates
  2. Eclipse Maven plugin (M2Eclipse) - http://download.eclipse.org/technology/m2e/releases
  3. Maven SCM Handler for EGit (m2e-egit)

    Install from the M2E Marketplace (Settings → Maven → Discovery → Open Catalog and search for " m2e-egit")


Step 2 : Clone the repository

Clone(download) your Maven Projects from Git

Check out non-eclipse Maven Projects from Git (File → Import.. → Maven → Check out Maven Projects from SCM)

File → Import.. → Maven → Check out Maven Projects from SCM

Now add your git repository link to SCM URI field.Then click next & finish.