本文翻译自:How to fix error “Updating Maven Project”. Unsupported IClasspathEntry kind=4?
I have imported maven project in STS, when I run update update project I receive: 我在STS中导入了maven项目,当我运行我收到的更新更新项目时:
"Updating Maven Project". Unsupported IClasspathEntry kind=4
Is there a workaround for this? 这有解决方法吗?
#1楼
参考:https://stackoom.com/question/iKM8/如何修复错误-正在更新Maven项目-不支持的IClasspathEntry种类
#2楼
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. 这个问题是由于STS(Spring IDE / Eclipse)以及Eclipse和其他基于Eclipse的IDE使用m2e(clipse)插件,但eclipse:eclipse可能已经在项目上运行了。 When m2e encounters a "var" .classpath entry, it throws this error. 当m2e遇到“var”.classpath条目时,它会抛出此错误。
The update sites are specified at the following url: 更新站点在以下URL指定:
http://eclipse.org/m2e/m2e-downloads.html http://eclipse.org/m2e/m2e-downloads.html
If you can't use m2e 1.5.0 for any reason, then : 如果您因任何原因无法使用m2e 1.5.0,那么:
Disable the maven nature for the project (via the right-click menu) 禁用项目的maven性质(通过右键单击菜单)
Run
mvn eclipse:clean
(while your project is open in STS/eclipse). 运行mvn eclipse:clean
(当你的项目在STS / eclipse中打开时)。 Depending on the timing, you might need to do a refresh or two on the project before re-enabling the maven nature. 根据时间的不同,您可能需要在重新启用maven性质之前对项目进行一次或两次刷新。 You should be able to see that your project has lost it's Maven nature. 您应该能够看到您的项目失去了它的Maven性质。 (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
.) (eclipse:clean
目标只删除.project
,.classpath
和.settings/
files /目录。你也可以删除那些文件( 在项目打开时再次删除),而不是运行mvn eclipse:clean
。)Re-enable the maven nature. 重新启用maven性质。
(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项目”来完成此操作。
#3楼
This error is also thrown if the update command is used on a project instrumented for code coverage with Clover. 如果在使用Clover进行代码覆盖的检测项目上使用更新命令,则也会引发此错误。
To resolve in this scenario: Un-instrument the project folders you wish to update. 要在此方案中解决:取消对要更新的项目文件夹的检测。 Run the maven update then instrument for code coverage again. 运行maven更新,然后再次使用仪器进行代码覆盖。
#4楼
I tried Marco's steps but no luck. 我尝试了Marco的步骤,但没有运气。 Instead if you just get the latest m2e plugin from the link he provides and one by one right click on each project -> Maven -> Update Dependencies the error still pops up but the issue is resolved. 相反,如果您只是从他提供的链接中获取最新的m2e插件,并逐一右键单击每个项目 - > Maven - > Update Dependencies,错误仍会弹出,但问题已解决。 That is to say the warnings disappear in the Markers view. 也就是说,警告在Markers视图中消失了。 I encountered this issue after importing some projects into SpringSource Tool Suite (STS). 将一些项目导入SpringSource Tool Suite(STS)后,我遇到了这个问题。 When I returned to my Eclipse Juno installation the warnings were displaying. 当我返回Eclipse Juno安装时,会显示警告。 Seeing that I had m2e 1.1 already installed I tried Marco's steps to no avail. 看到我已经安装了m2e 1.1,我试过Marco的步骤无济于事。 Getting the latest version fixed it however. 然而,获得最新版本修复了它。
#5楼
Make sure that the version of the m2e(clipse) plugin that you're running is at least 1.1.0 确保您运行的m2e(clipse)插件的版本至少为1.1.0
Close maven project - right click "Close Project" 关闭maven项目 - 右键单击“关闭项目”
- Manualy remove all classpathentry with kind="var" in .classpath file Manualy在.classpath文件中删除kind =“var”的所有classpathentry
- Open project 打开项目
or 要么
- Remove maven project 删除maven项目
- Manualy rmeove .classpath 4 Reimport project Manualy rmeove .classpath 4重新进口项目
#6楼
Have you tried: 你有没有尝试过:
- If you have import project into the eclipse 4, please delete it. 如果你有导入项目进入eclipse 4,请删除它。
- In maven consol, run: mvn eclipse:clean 在maven consol中,运行:mvn eclipse:clean
- In Eclipse 4: File -> Import -> Maven -> Existing Maven Projects 在Eclipse 4中:文件 - >导入 - > Maven - >现有Maven项目