Reputation: 11141
I have forked this project on my GitHub:
and now I'm trying to import (clone) my own origin repo locally. I managed to do it via Bash command line, but I'm not being able to import the project in Eclipse and make it a "Java Project". It's imported as a "Generic project" where packages are seen as plain directories:
The import wizard gives these 3 options:
If I go with the first one it says "No projects found" and if I go with the second I have no idea how to proceed.
Is this the wrong way to go? I'm using Eclipse Mars (4.5.1) with EGit plugin.
Upvotes: 4
Views: 938
Reputation: 137319
What you are trying to import is actually a Maven project. First of all, make sure you have M2Eclipse installed, so that the projects can be imported and built automatically.
What I usually do in those cases is the following (pictures are taken with Eclipse Mars 4.5.1, you will need to adjust with your Eclipse installation but it shouldn't change much):
Clone the Git repository with the URL: https://github.com/iluwatar/java-design-patterns.git
.
Select the master
branch only
Once Eclipse has downloaded everything, I do not use the import facility but instead let Eclipse finish and do nothing.
At this point, there are 2 approaches possible. The repository is checked out into your machine, and the projects need to be imported in Eclipse as Maven projects.
NOTE: this solution requires the m2e-egit
connector to be installed. Refer to this answer to locate and install it. The connector will be located at the bottom of the list, below the "m2e Team providers" section, and is named m2e-egit
.
Still in the Git perspective, expand the Git repository, right-click "Working Tree", and select "Import Maven Projects..."
In both of those cases, you will be greeted with the following dialog, where you can select all the Maven projects you just downloaded and import them.
Upvotes: 6
Reputation: 3984
Since your project seems to be using pom.xml, use Maven's eclipse plugin to create an Eclipse project.
Upvotes: 0