如何修复错误“更新 Maven 项目".不支持的 IClasspathEntry kind=4? [英] How to fix error "Updating Maven Project". Unsupported IClasspathEntry kind=4?
问题描述
我在 STS 中导入了 Maven 项目,当我运行更新更新项目时,我收到:
更新 Maven 项目".不支持的 IClasspathEntry kind=4
是否有解决方法?
此问题已在 m2e 1.5.0 中修复,可用于 Eclipse Kepler (4.3) 和 Luna (4.4)>
请参阅https://bugs.eclipse.org/bugs/show_bug.cgi?id=374332#c14
问题是由 STS(Spring IDE/Eclipse)以及 Eclipse 和其他基于 Eclipse 的 IDE 使用 m2e(clipse) 插件引起的,但 eclipse:eclipse 可能已在项目上运行.当 m2e 遇到var".classpath 条目时,它会抛出此错误.
更新站点在以下 URL 中指定:
http://eclipse.org/m2e/m2e-downloads.html
如果您因任何原因无法使用 m2e 1.5.0,则:
禁用项目的 Maven 特性(通过右键菜单)
运行
mvn eclipse:clean
(当您的项目在 STS/eclipse 中打开).根据时间安排,在重新启用 Maven 特性之前,您可能需要对项目进行一两次刷新.您应该能够看到您的项目已经失去了它的 Maven 性质.(eclipse:clean
目标只是删除.project
、.classpath
和.settings/
文件/目录.您也可以只删除这些文件(再次在项目打开时)而不是运行mvn eclipse:clean
.)重新启用 maven 特性.
(大多数情况下,这可以通过在包资源管理器窗格中右键单击相关项目,然后选择配置"->转换为 Maven 项目"来完成)
I have imported maven project in STS, when I run update update project I receive:
"Updating Maven Project". Unsupported IClasspathEntry kind=4
Is there a workaround for this?
This issue has been fixed in m2e 1.5.0 which is available for Eclipse Kepler (4.3) and Luna (4.4)
Please see 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.
The update sites are specified at the following url:
http://eclipse.org/m2e/m2e-downloads.html
If you can't use m2e 1.5.0 for any reason, then :
Disable the maven nature for the project (via the right-click menu)
Run
mvn eclipse:clean
(while your project is open in STS/eclipse). Depending on the timing, you might need to do a refresh or two on the project before re-enabling the maven nature. You should be able to see that your project has lost it's Maven nature. (Theeclipse:clean
goal just deletes the.project
,.classpath
and.settings/
files/directories. You can also just remove those files (again while the project is open) instead of runningmvn eclipse:clean
.)Re-enable the maven nature.
(Most of the time, this can be done by right-clicking on the project in question in the package explorer pane, and then choosing 'Configure'-> 'Convert to Maven Project')
这篇关于如何修复错误“更新 Maven 项目".不支持的 IClasspathEntry kind=4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!