“项目描述无效”,从 GIT 存储库导入问题

发布于 2024-11-08 17:47:21 字数 1647 浏览 0 评论 0原文

将我的 GIT 存储库从 PC 计算机复制到我的 MAC 后,我似乎无法将其导入到 Eclipse 中。通过 eGit 插件直接从现有的本地 git 存储库导入。

同样的导入在现有的 Windows 计算机上运行得非常好。

请指教。

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'

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'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

独行侠 2024-11-15 17:47:22

当使用导入项目克隆远程 git 存储库时会发生这种情况 ->来自 git 的项目
在最后一步。

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

狼亦尘 2024-11-15 17:47:22

嗯,我在 git repos 上遇到了类似的问题(使用 git 工具从命令行克隆):当我导入 Eclipse 工作区中克隆的项目时,Eclipse 正在损坏项目目录中的 .git 索引。比我克隆git repo 在工作区之外使用“复制到工作区”复选框在Eclipse中导入,一切都很顺利......

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

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

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.

じ违心 2024-11-15 17:47:22

你不应该复制 git repos,你应该克隆它们。但是,查看您的错误消息,它看起来根本不像 git 问题。

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.

魔法唧唧 2024-11-15 17:47:22

我刚刚遇到了这个错误;为了解决这个问题,我从工作区目录中删除了该项目。我把它扔到了桌面上。然后在导入项目时,选中“复制到工作区”复选框。

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

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.

倚栏听风 2024-11-15 17:47:22

请检查一下。
我有一个多层次的项目。我无法导入我的子项目之一,因为它给了我“无效的项目描述,资源包含/”。这是因为我的子项目应用了插件:“eclipse”我认为是这样。
这是一个已知问题,并为此创建了一个错误:
https://issuetracker.springsource.com/browse/STS-2614

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

听风吹 2024-11-15 17:47:22
mvn eclipse:clean eclipse:eclipse 

我从终端运行上述命令,并解决了 Eclipse 中的构建问题。

mvn eclipse:clean eclipse:eclipse 

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

ぽ尐不点ル 2024-11-15 17:47:22

我遇到了同样的问题,但我删除了 eclipse '.project' 文件并且导入工作正常。

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

谢绝鈎搭 2024-11-15 17:47:21

“包含:/Users/me/Repositories/ABC 与另一个项目的位置重叠:'ABC'”

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

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

长发绾君心 2024-11-15 17:47:21

以下对我有用。

将您的项目复制/放置到工作区之外 [例如:E:\yourproject ],然后转到
1. 文件-->导入-->常规-->现有项目到工作区
2.浏览您的项目
3. 选择复选框“将项目复制到工作区”
然后按“完成”。
它将把项目的副本复制到工作区中。

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.

标点 2024-11-15 17:47:21

好吧,在我遇到类似的问题并浪费了一些时间之后,我会尝试总结一下:

Eclipse Juno /4.2 SR1
(但是我认为这是对 ecplise 如何导入项目的普遍误解)

  1. 如果你希望你的新项目“连接”到 git/mercurial,你必须通过“Import/Git/Import from Git”克隆和导入
  2. 。如果您的“工作空间目录”等于“本地目标目录”,则会失败。
    不得放置通过 egit 进行的 git 克隆!在“eclipse工作区目录”中!

项目导入将失败,因为导入时克隆的“.project 文件”中的项目名称已存在于 eclipse 工作区目录中。

希望这可以节省一些时间。

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.

留蓝 2024-11-15 17:47:21

尝试为工作区和 git 项目使用不同的目录。
工作区-> wsp,Git 项目 -> wsp/git-project 而不是:
工作区/Git 项目 -> git 项目

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

葬﹪忆之殇 2024-11-15 17:47:21

我遇到了同样的问题,一段时间后发现以下解决方案保留 git repo:

  1. 从工作区中删除项目(即使 eclipse 说失败,它也在那里)
  2. 将项目导入为“导入 -> 常规 -> 现有项目到工作区”
  3. 修复 repo 为“团队 -> 共享项目 -> Git ->”

再注意一点,您的项目应包含 .git 文件夹

这对我来说工作正常

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

烟若柳尘 2024-11-15 17:47:21

您的工作区中已有 ABC。删除它然后添加这个。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文