21

After copying my GIT repo from a PC computer onto my MAC, i can't seem to import it to an eclipse. Import happens via eGit plugin directly from existing local git repository.

Same exact import works perfectly fine on existing Windows computer.

Please advise.

org.eclipse.core.internal.resources.ResourceException: Invalid project description.
        at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:162)
        at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:52)
        at org.eclipse.core.internal.resources.Project.create(Project.java:274)
        at org.eclipse.core.internal.resources.Project.create(Project.java:256)
        at org.eclipse.egit.ui.internal.clone.ProjectUtils.createExistingProject(ProjectUtils.java:115)
        at org.eclipse.egit.ui.internal.clone.ProjectUtils.access$0(ProjectUtils.java:92)
        at org.eclipse.egit.ui.internal.clone.ProjectUtils$1.run(ProjectUtils.java:66)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1957)
        at org.eclipse.egit.ui.internal.clone.ProjectUtils.createProjects(ProjectUtils.java:84)
        at org.eclipse.egit.ui.internal.clone.GitImportWizard.importProjects(GitImportWizard.java:160)
        at org.eclipse.egit.ui.internal.clone.GitImportWizard.access$0(GitImportWizard.java:142)
        at org.eclipse.egit.ui.internal.clone.GitImportWizard$1.run(GitImportWizard.java:83)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
    Contains: OK
    Contains: /Users/me/Repositories/ABC overlaps the location of another project: 'ABC'
manojlds
  • 290,304
  • 63
  • 469
  • 417
James Raitsev
  • 92,517
  • 154
  • 335
  • 470

13 Answers13

29

"Contains: /Users/me/Repositories/ABC overlaps the location of another project: 'ABC'"

Looks like you already have a project in your workspace with the same name like the project you would like to import.

dunni
  • 43,386
  • 10
  • 104
  • 99
  • 4
    You know ... one thing i did not realize is that my workspace and repo were in the same place ... Who knew. For those who may be dealing with similar issue, check whether there exists a parent repo, inside which repo you are trying to load into Eclipse exists – James Raitsev May 21 '11 at 20:30
  • 4
    Unless I'm missing something this doesn't answer the underlying problem that eclipse says: "Invalid Project Description" - the exception that person asking originally reported. – Mark Levison Nov 11 '12 at 22:32
  • The underlying problem is this: "Contains: /Users/me/Repositories/ABC overlaps the location of another project: 'ABC'". I suspect, that he checked the checkbox to copy the projects into his workspace, while the Git repository and a folder with the same name as the project was already there. – dunni Nov 12 '12 at 06:14
10

Following is worked for me.

Copy/put your project outside of workspace [e.g : E:\yourproject ], then Go to
1. File-->Import-->General-->Existing Projects into Workspace
2. Browse your project
3. Select Checkbox "Copy projects into workspace" and press Finish.
It will make copy of project into workspace.

Sunil Parmar
  • 1,223
  • 1
  • 13
  • 22
  • 1
    If a project is already in the workspace folder, sometimes importing will cause the 'Invalid Description' error. Checking 'Copy Project into Workspace' fixes this error, even though the project is already in the workspace folder. – deepwinter May 17 '13 at 22:10
  • This is TRAP!! if you import the project into the workspace and the project is in the workspace, and you select copy into the workspace, it'll empty (keep filename but set size to zero) every single file in the project, including files going through symbolic links to third party libraries. I did this and it took me hours to sort out the mess – martinako Nov 18 '13 at 15:18
  • 2
    Eclipse is going to kill me of heart attack! – martinako Nov 18 '13 at 15:19
9

Ok, i'll try to sum it up, after I faced similiary problems and wasted some time:

Eclipse Juno /4.2 SR1 (however I think it is a general misunderstanding of how ecplise imports projects)

  1. If you want your new project "connected" to git/mercurial, you'll have to clone and import via "Import/Git/Import from Git"
  2. The import will fail if your "workspace dir" equals the "local destination dir". A git clone via egit MUST NOT be placed! in the "eclipse workspace dir"!

The project import will fail because the projectname in the cloned ".project file" allready exists in the eclipse workspace dir when the import occurs.

Hope this saves some time.

M. P.
  • 181
  • 2
  • 5
4

Try to use different directories for workspace and git project. Workspace -> wsp, Git-Project -> wsp/git-project instead of: Workspace/Git-Project -> git-project

2

I've meet the same issue and after some time found following solution to remain git repo:

  1. remove project from workspace (it's there even if eclipse says about failure)
  2. import project as "Import -> General -> Existing Projects into Workspace"
  3. repair repo as "Team -> Share project -> Git -> "

Just one more note, your project shall contain .git folder

It's working fine for me

alexuz
  • 778
  • 6
  • 6
1

Hm I had similar problem with git repos (cloned from command line using git tool): Eclipse was damaging .git index inside project dir when I was importing projects cloned inside eclipse workspace. Than I cloned git repo outside workspace and imported in eclipse using "copy into workspace" checkbox and everything worked smoothly...

But it is worth to mention that I downloaded Eclipse Classic which comes without egit or without any git related plugins, because I had suspect that this egit plugin was resetting .git directory besides other import problems.

Maybe importing outside working dir is something what eclipse programmers want from us.

BIOHAZARD
  • 1,937
  • 20
  • 23
1

You have ABC already in your workspace. Remove it and then add this one.

manojlds
  • 290,304
  • 63
  • 469
  • 417
1

This happens when cloning a remote git repository using import project -> project from git in the last step.

Marcus Wolschon
  • 2,550
  • 2
  • 22
  • 28
0

I just had this error; in order to solve it I removed the project from my workspace directory. I threw it on my desktop. Then when importing the project, check the box that says copy into workspace.

Eclipse checks in your workspace to see if the directory exists already, if it does, it gives the error.

JustinDanielson
  • 3,155
  • 1
  • 19
  • 26
0

Please do check this out. I had a multi level project. I was not able to import one of my subprojects because it gave me "invalid project description, resource contains /". This was because my subprojects had apply plugin: 'eclipse' I think so. This is a known issue and there is a bug created for it: https://issuetracker.springsource.com/browse/STS-2614

0
mvn eclipse:clean eclipse:eclipse 

I run above command from terminal and build issues in eclipse were resolved.

anandxp
  • 66
  • 1
  • 2
0

I had the same problem but I deleted the eclipse '.project' files and the import worked.

RodP
  • 382
  • 2
  • 12
0

You should not copy git repos, you should clone them. However, looking at your error message, it doesn't especially seem like a git problem at all.

Seth Robertson
  • 30,608
  • 7
  • 64
  • 57