Search code examples
javaeclipsegitmavengithub

Adviseable Git repository structure for a Maven Project to be used from Eclipse IDE


I have an Eclipse maven project which I have moved to GitHub recently. The directory structure is like this:

Git Repo
|__Eclipse Folder
|____src
|____pom.xml

The problem with this is when my teammates clone the project in Eclipse they cannot convert it to a maven project so I have to change the structure as:

Git Repo 
|__src
|__pom.xml

Is there any elegant way to handle this?


Solution

  • your issue seem to be that your Eclipse and Github project do not have the same name so you have a project folder inside your Github folder.

    What would be an ideal solution in this case is to use the Git_Root_Repository as the Eclipse_project_folder as seen on this link to keep a neat Github repo.

    To achieve this try to move the src/ and pom.xml up directly under the Git_Root_Repository and re-import the project as a Maven project in Eclipse.