1

I have Eclipse Maven Java project on my first PC. I have committed this project to GIT repository with directory structure:

src/main/java
pom.xml

What is the right way to get project in another PC like Eclipse Java Maven one?

Should I start new Maven project, go through all initial settings and later somehow checkout git project into current project directory?

vico
  • 17,051
  • 45
  • 159
  • 315
  • 2
    Possible duplicate of [Importing maven project into eclipse](https://stackoverflow.com/questions/2061094/importing-maven-project-into-eclipse) – azro Nov 21 '18 at 22:06
  • In the _Git Repositories_ view right-click the repository and choose _Import Projects..._. – howlger Nov 21 '18 at 22:07
  • @azro Well, the question is a duplicate, but the answers are unfortunately all outdated (written before the so-called _Smart Import_ has been introduced). – howlger Nov 21 '18 at 22:11
  • @howlger Can you please add the *Smart Import* as an answer to that question? Lets update that instead of adding inconsistent duplicates. – omajid Nov 21 '18 at 22:45
  • @omajid That question is not about importing from Git. Therefore I gave a [slightly different answer there](https://stackoverflow.com/a/53421870/6505250). – howlger Nov 21 '18 at 23:30

2 Answers2

0

I would recommend one of the following two:

  • In the Git Repositories view right-click the repository node, one folder or multiple selected folders in the Working Tree and choose Import Projects...
  • File > Projects from File System... and choose the directory of the local Git repository
howlger
  • 31,050
  • 11
  • 59
  • 99
0

I follow this way:

Git:

  • Clone my project in a local directory

Eclipse:

  • Click File menu

  • Choose Import...

  • Click Maven and choose Existing Maven Projects and click Next

  • Set Root Directory to cloned project directory from Browse... and check pom.xml in Projects: section and finally Click Finish button.

Done!

mmuzahid
  • 2,252
  • 23
  • 42