“无效项目描述”,从GIT repo问题导入。

时间:2021-12-16 11:24:31

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.

在把我的GIT repo从PC电脑上复制到MAC上之后,我似乎无法将它导入到eclipse中。从现有的本地git存储库直接导入eGit插件。

Same exact import works perfectly fine on existing Windows computer.

在现有的Windows电脑上,同样精确的导入操作也非常完美。

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'

13 个解决方案

#1


25  

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

包含:/用户/me/储存库/ABC与另一个项目的位置重叠:“ABC”

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

看起来您的工作区中已经有一个项目,名称与您想要导入的项目相同。

#2


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)

Eclipse Juno /4.2 SR1(不过我认为这是对ecplise导入项目的一个普遍误解)

  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. 如果您希望您的新项目“连接”到git/mercurial,您将不得不通过“从git导入/ git/导入”来克隆和导入。
  3. 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"!
  4. 如果您的“workspace dir”等于“local destination dir”,那么导入将失败。通过egit的git克隆不能被放置!在“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.

项目导入将失败,因为被克隆的项目名称。当导入发生时,项目文件“allready存在于eclipse工作区目录中”。

Hope this saves some time.

希望这能节省一些时间。

#3


7  

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.

以下是我的工作。把你的项目放在工作区外[e]。E:\你的项目],然后去1。文件——>导入——>General——>现有项目进入工作区2。浏览您的项目3。选中复选框“将项目复制到工作区中”并单击Finish。它将把项目复制到工作区中。

#4


5  

The easiest solution I've seen come across for this is to use Import -> General -> Existing Projects into Workspace.

我看到的最简单的解决方案是使用Import -> General ->现有的项目到工作区中。

#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

尝试为workspace和git项目使用不同的目录。工作空间-> wsp, Git-Project -> wsp/git-项目,而不是:Workspace/Git-Project -> Git-Project。

#6


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. 从工作区中移除项目(即使eclipse提到了失败)
  3. import project as "Import -> General -> Existing Projects into Workspace"
  4. 导入项目为“导入->通用->现有项目进入工作空间”
  5. repair repo as "Team -> Share project -> Git -> "
  6. 修复repo作为“团队->共享项目-> Git ->”

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

另外,您的项目将包含.git文件夹。

It's working fine for me

对我来说没问题。

#7


1  

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

你的工作空间里已经有了ABC。去掉它,然后加上这个。

#8


1  

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

这发生在使用import project ->项目在最后一个步骤中从git中克隆一个远程git存储库时。

#9


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...

嗯,我在git repos(使用git工具的命令行克隆)上遇到了类似的问题:当我导入在Eclipse工作空间中克隆的项目时,Eclipse在project dir中破坏了.git索引。我在工作空间中克隆了git repo,并使用“copy into workspace”复选框导入eclipse,一切工作都很顺利……

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.

但是值得一提的是,我下载了Eclipse Classic,它没有egit,也没有任何git相关插件,因为我怀疑这个egit插件正在重新设置.git目录,除了其他导入问题。

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

可能导入外部工作目录是eclipse程序员想要从我们这里得到的东西。

#10


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.

您不应该复制git repos,您应该克隆它们。然而,查看您的错误消息,它并不特别像一个git问题。

#11


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.

Eclipse在您的工作区中检查目录是否已经存在,如果它已经存在,则会给出错误。

#12


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

请检查一下。我有一个多层次的项目。我不能导入我的一个子项目,因为它给了我“无效的项目描述,资源包含/”。这是因为我的子项目已经应用了插件:“eclipse”。这是一个已知的问题,并且有一个为它创建的bug: https://issue。springsource.com/browse/sts-2614。

#13


0  

mvn eclipse:clean eclipse:eclipse 

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

我从终端运行上面的命令,并在eclipse中构建问题。

#1


25  

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

包含:/用户/me/储存库/ABC与另一个项目的位置重叠:“ABC”

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

看起来您的工作区中已经有一个项目,名称与您想要导入的项目相同。

#2


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)

Eclipse Juno /4.2 SR1(不过我认为这是对ecplise导入项目的一个普遍误解)

  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. 如果您希望您的新项目“连接”到git/mercurial,您将不得不通过“从git导入/ git/导入”来克隆和导入。
  3. 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"!
  4. 如果您的“workspace dir”等于“local destination dir”,那么导入将失败。通过egit的git克隆不能被放置!在“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.

项目导入将失败,因为被克隆的项目名称。当导入发生时,项目文件“allready存在于eclipse工作区目录中”。

Hope this saves some time.

希望这能节省一些时间。

#3


7  

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.

以下是我的工作。把你的项目放在工作区外[e]。E:\你的项目],然后去1。文件——>导入——>General——>现有项目进入工作区2。浏览您的项目3。选中复选框“将项目复制到工作区中”并单击Finish。它将把项目复制到工作区中。

#4


5  

The easiest solution I've seen come across for this is to use Import -> General -> Existing Projects into Workspace.

我看到的最简单的解决方案是使用Import -> General ->现有的项目到工作区中。

#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

尝试为workspace和git项目使用不同的目录。工作空间-> wsp, Git-Project -> wsp/git-项目,而不是:Workspace/Git-Project -> Git-Project。

#6


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. 从工作区中移除项目(即使eclipse提到了失败)
  3. import project as "Import -> General -> Existing Projects into Workspace"
  4. 导入项目为“导入->通用->现有项目进入工作空间”
  5. repair repo as "Team -> Share project -> Git -> "
  6. 修复repo作为“团队->共享项目-> Git ->”

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

另外,您的项目将包含.git文件夹。

It's working fine for me

对我来说没问题。

#7


1  

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

你的工作空间里已经有了ABC。去掉它,然后加上这个。

#8


1  

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

这发生在使用import project ->项目在最后一个步骤中从git中克隆一个远程git存储库时。

#9


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...

嗯,我在git repos(使用git工具的命令行克隆)上遇到了类似的问题:当我导入在Eclipse工作空间中克隆的项目时,Eclipse在project dir中破坏了.git索引。我在工作空间中克隆了git repo,并使用“copy into workspace”复选框导入eclipse,一切工作都很顺利……

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.

但是值得一提的是,我下载了Eclipse Classic,它没有egit,也没有任何git相关插件,因为我怀疑这个egit插件正在重新设置.git目录,除了其他导入问题。

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

可能导入外部工作目录是eclipse程序员想要从我们这里得到的东西。

#10


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.

您不应该复制git repos,您应该克隆它们。然而,查看您的错误消息,它并不特别像一个git问题。

#11


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.

Eclipse在您的工作区中检查目录是否已经存在,如果它已经存在,则会给出错误。

#12


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

请检查一下。我有一个多层次的项目。我不能导入我的一个子项目,因为它给了我“无效的项目描述,资源包含/”。这是因为我的子项目已经应用了插件:“eclipse”。这是一个已知的问题,并且有一个为它创建的bug: https://issue。springsource.com/browse/sts-2614。

#13


0  

mvn eclipse:clean eclipse:eclipse 

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

我从终端运行上面的命令,并在eclipse中构建问题。