eclipse 期间发生内部错误:“更新 Maven 项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11832647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 21:15:05  来源:igfitidea点击:

An internal error occurred during: "Updating Maven Project

eclipsemaven

提问by liuzhijun

when i convert to maven project the error is :

当我转换为 maven 项目时,错误是:

> An internal error occurred during: "Updating Maven Project".
> Unsupported IClasspathEntry kind=4

what's the problem?

有什么问题?

回答by Alireza Mazloumi

This is all you need:

这就是你所需要的:

  1. Right-click on your project, select Maven -> Disable Maven Nature.
  2. Open you terminal, go to your project folder and do “mvn eclipse:clean”
  3. Right click on your Project and select “Configure -> Convert into Maven Project”
  1. 右键单击您的项目,选择 Maven -> 禁用 Maven Nature。
  2. 打开你的终端,进入你的项目文件夹并执行“mvn eclipse:clean”
  3. 右键单击您的项目并选择“配置 -> 转换为 Maven 项目”

回答by George

Here is what worked for me: After the steps posted in Answer 21 above (the last being Convert to Maven Project), I did:

这是对我有用的方法:在上面的答案 21 中发布的步骤(最后一个是转换为 Maven 项目)之后,我做了:

  1. mvn eclipse:eclipse- this regenerates your .project and .classpath files (both of which were blown away by mvn eclipse:cleanin step (2) above)

  2. In Eclipse, I right-clicked my project(s) and then Maven > Update Project

  1. mvn eclipse:eclipse- 这会重新生成您的 .project 和 .classpath 文件(这两个文件都mvn eclipse:clean在上面的步骤 (2) 中被吹走了)

  2. 在 Eclipse 中,我右键单击我的项目,然后单击 Maven > Update Project

I did not see the Unsupported IClasspathEntry kind=4message anymore :)

我再也没有看到Unsupported IClasspathEntry kind=4消息:)

回答by pabloi

As posted here, the problem is the command line eclipse project generation. So, do not use mvn eclipse:eclipse instead do:

正如此处发布的,问题是命令行 eclipse 项目生成。所以,不要使用 mvn eclipse:eclipse 而是做:

  1. delete your project from eclipse (without deleting it from your file system)
  2. do mvn eclipse:clean in your command line inside your project folder
  3. delete .classpath .project .settings in your project folder (if they still exist after doing 2.)
  4. in eclipse import your project as an "Existing Maven Projects" and it should work flawlessly
  1. 从 Eclipse 中删除您的项目(不从文件系统中删除它)
  2. 在项目文件夹内的命令行中执行 mvn eclipse:clean
  3. 删除项目文件夹中的 .classpath .project .settings (如果它们在执行 2 后仍然存在。)
  4. 在 Eclipse 中将您的项目作为“现有 Maven 项目”导入,它应该可以完美运行

回答by dermoritz

In my case the problem was a .settings-folder commited to svn. it contained the wrong settings (in my case the jdk was set to wrong location). So deleting .settings on svn and doing a clean checkout did it.

就我而言,问题是提交给 svn 的 .settings-folder。它包含错误的设置(在我的情况下,jdk 被设置为错误的位置)。因此,删除 svn 上的 .settings 并进行干净的结帐就可以了。

回答by Amit S

Following worked for me: Right-click project, select Maven -> Remove Maven Nature. Close Eclipse go to project folder on command prompt and do “mvn eclipse:clean” Start Eclipse Right click on Project and select “Configure -> Convert into Maven Project”

以下对我有用:右键单击项目,选择 Maven -> 删除 Maven Nature。关闭 Eclipse 在命令提示符下转到项目文件夹并执行“mvn eclipse:clean”启动 Eclipse 右键单击​​项目并选择“配置 -> 转换为 Maven 项目”

回答by Richard

I meet the same problem before when I import a project as a maven project. what I did is like is right click project and choose Maven -> Update Project... (Alt-F5) on the context menu. In the Update Maven Project dialog, ensure that "Update project configuration from pom.xml" is checked. Then press OK.

当我将项目作为 maven 项目导入时,我遇到了同样的问题。我所做的就像是右键单击项目并在上下文菜单上选择 Maven -> 更新项目...(Alt-F5)。在“更新 Maven 项目”对话框中,确保选中“从 pom.xml 更新项目配置”。然后按确定。

The issue should be resolved.

问题应该得到解决。

Another way is, you go to Problem tab, and find the Error, there is a hint saying that right click it and use Quick fix to resolve the problem.

另一种方法是,您转到问题选项卡,找到错误,有提示说右键单击它并使用快速修复来解决问题。

回答by Pushkar

This issue has been fixed in m2e 1.5.0 which is available for Eclipse Kepler (4.3) and Luna (4.4)

此问题已在 m2e 1.5.0 中修复,可用于 Eclipse Kepler (4.3) 和 Luna (4.4)

Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=374332#c14

请参阅https://bugs.eclipse.org/bugs/show_bug.cgi?id=374332#c14

The problem is caused by the fact that STS (the Spring IDE/Eclipse), as well Eclipse and other Eclipse based IDE's, use the m2e(clipse) plugin but that eclipse:eclipse has been probably been run on the project. When m2e encounters a "var" .classpath entry, it throws this error.

问题是由于 STS(Spring IDE/Eclipse)以及 Eclipse 和其他基于 Eclipse 的 IDE 使用 m2e(clipse) 插件,但 eclipse:eclipse 可能已在项目上运行。当 m2e 遇到“var”.classpath 条目时,它会抛出此错误。

The update sites are specified at the following url: http://download.eclipse.org/technology/m2e/milestones/1.6/

更新站点在以下 URL 中指定:http: //download.eclipse.org/technology/m2e/milestones/1.6/

回答by Joey Tang

Revert back to an earlier commit/change fixes the problem.... so it could be some corrupted project/mvn file issue, somehow. So, I followed the steps to clean up and then import the project.It worked after a couple attempts.

恢复到较早的提交/更改修复了问题......所以它可能是一些损坏的项目/mvn 文件问题,不知何故。所以,我按照步骤清理然后导入项目。经过几次尝试,它起作用了。

回答by Ahmed

An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4

期间发生内部错误:“导入 Maven 项目”。不支持的 IClasspathEntry kind=4

  1. Right-click on your project, select Maven -> Remove Maven Nature. 2.Open you terminal, go to your project folder and do “mvn eclipse:clean” 3.Right click on your Project and select “Configure -> Convert into Maven Project”
  1. 右键单击您的项目,选择 Maven -> 删除 Maven Nature。2.打开你的终端,进入你的项目文件夹并执行“mvn eclipse:clean” 3.右键单击你的项目并选择“Configure -> Convert into Maven Project”

also delete project from eclipse. and run: mvn eclipse:clean then import project again.

也从 eclipse 中删除项目。并运行: mvn eclipse:clean 然后再次导入项目。

回答by xavierzhao

  1. Switch to terminal and type command mvn eclipse:clean
  2. Right-click on you project, select Maven -> Update Project
  1. 切换到终端并输入命令 mvn eclipse:clean
  2. 右键单击您的项目,选择 Maven -> 更新项目

Okay, everything is settled

好了,一切都解决了