eclipse 在“更新 Maven 项目”期间发生内部错误。不支持的 IClasspathEntry kind=4
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15065093/
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
An internal error occurred during: "Updating Maven Project". Unsupported IClasspathEntry kind=4
提问by Vjeetje
As the title mentioned I have the following problem: I use Eclipse
with Maven Nature
and when I update my Maven Project, I get this error:
正如标题所提到的,我有以下问题:我用Eclipse
用Maven Nature
,当我更新我的Maven项目,我得到这个错误:
An internal error occurred during: "Updating Maven Project".
Unsupported IClasspathEntry kind=4
在“更新 Maven 项目”期间发生内部错误。
不支持的 IClasspathEntry kind=4
The solution that always comes back is the following:
总是回来的解决方案如下:
- rightclick project, remove maven nature
mvn eclipse:clean
(with project open in eclipse/STS)- (sometimes they suggest to do
mvn eclipse:eclipse
next) - rightclick project and reenable maven nature
- 右键单击项目,删除 maven 性质
mvn eclipse:clean
(在 eclipse/STS 中打开项目)- (有时他们建议
mvn eclipse:eclipse
下一步做) - 右键单击项目并重新启用 Maven 性质
Now I exhaustively tried all combinations several times. But I always keep getting the above error. The error starting occurring when I had to mvn eclipse:eclipse
the project. Before it was always running fine using only m2eclipsefeatures and setting everything in eclipse.
现在我彻底尝试了所有组合几次。但我总是不断收到上述错误。当我不得不进行mvn eclipse:eclipse
项目时,错误开始发生。在它只使用m2eclipse功能并在 eclipse 中设置所有内容之前它总是运行良好。
回答by Vjeetje
I had to do it slightly different to work for me:
为了对我来说有效,我不得不做一些稍微不同的事情:
- rightclick project, remove maven nature (or in newer eclipse, "Maven->Disable Maven Nature")
mvn eclipse:clean
(with project open in eclipse/STS)- delete the project in eclipse (but do not delete the sources)
- Import existing Maven project
- 右键单击项目,删除 Maven 自然(或在较新的 Eclipse 中,“Maven->禁用 Maven 自然”)
mvn eclipse:clean
(在 eclipse/STS 中打开项目)- 在 eclipse 中删除项目(但不要删除源)
- 导入现有的 Maven 项目
回答by Wiebke
I just went to
Properties
->Java Build Path
->Libraries
and removed the blue entries starting with M2_REPO.After that, I could use
Maven
->Update Project
again
我刚刚去了
Properties
->Java Build Path
->Libraries
并删除了以M2_REPO开头的蓝色条目。之后,我可以再次使用
Maven
->Update Project
回答by tharindu_DG
This is all you need:
这就是你所需要的:
Right-click on your project, select Maven -> Remove Maven Nature.
Open you terminal, navgate to your project folder and run
mvn eclipse:clean
Right click on your Project and select
Configure -> Convert into Maven Project
Right click on your Project and select
Maven -> Update Project
右键单击您的项目,选择 Maven -> Remove Maven Nature。
打开你的终端,导航到你的项目文件夹并运行
mvn eclipse:clean
右键单击您的项目并选择
Configure -> Convert into Maven Project
右键单击您的项目并选择
Maven -> Update Project
回答by mitunome
After trying all these procedures it still didn't work for me. What did work was
在尝试了所有这些程序后,它仍然对我不起作用。什么工作是
- go into File Explorer and delete the .classpath file under the project's root folder
- run Maven update within Eclipse, and check Force update of Snapshots/Releases
- 进入文件资源管理器并删除项目根文件夹下的 .classpath 文件
- 在 Eclipse 中运行 Maven 更新,并检查强制更新快照/发布
Our current work required integrating a number of disparate projects so unfortunately use of SNAPSHOTs in a production environment were required (taboo in Maven circles)!
我们当前的工作需要集成许多不同的项目,因此不幸的是,需要在生产环境中使用 SNAPSHOT(Maven 圈子中的禁忌)!
回答by Fred Bricon
This issue (https://bugs.eclipse.org/394042) is fixed in m2e 1.5.0 which is available for Eclipse Kepler and Luna from this p2 repo :
这个问题 ( https://bugs.eclipse.org/394042) 在 m2e 1.5.0 中得到修复,它可用于 Eclipse Kepler 和 Luna 从这个 p2 repo :
http://download.eclipse.org/technology/m2e/releases/1.5
http://download.eclipse.org/technology/m2e/releases/1.5
If you also use m2e-wtp, you'll need to install m2e-wtp 1.1.0 as well :
如果您还使用 m2e-wtp,则还需要安装 m2e-wtp 1.1.0:
回答by Helio Bentzen
I solved this by looking at this comment on JBIDE-11655 : deleting all .project, .settings and .classpath in my projects folder.
我通过查看 JBIDE-11655 上的这条评论解决了这个问题:删除我的项目文件夹中的所有 .project、.settings 和 .classpath。
回答by aan
I imported the project as general project from git repository.
我从 git 存储库中将项目作为一般项目导入。
- Deleted
.settings
,.project
and.classpath
in project's folder Configure -> Convert to Maven Project
. Only this solved the problem in my case.
- 已删除
.settings
,.project
并.classpath
在项目的文件夹中 Configure -> Convert to Maven Project
. 只有这解决了我的问题。
回答by QuangHao
I have that problem and my solution is going source folder and run command line: mvn clean install -DskipTests eclipse:eclipsethen return eclipse workspace and refresh project. Hope that help!
我有这个问题,我的解决方案是转到源文件夹并运行命令行:mvn clean install -DskipTests eclipse:eclipse然后返回 eclipse 工作区并刷新项目。希望有所帮助!
回答by eadjei
Your command line mvn eclipse project generator may not be the same version as that of your eclipse, and eclipse doesn't understand for your command line tool is generating. Just use eclipse's in this case:
您的命令行 mvn eclipse 项目生成器可能与您的 eclipse 版本不同,并且 eclipse 无法理解您的命令行工具正在生成。在这种情况下只需使用 eclipse :
- remove the project from eclipse (including all modules if multi-module)
- run:
rm -rf .settings/ .project .classpath
to delete eclipse project files, also from modules - import your project as an existing maven project
- 从 Eclipse 中删除项目(如果是多模块,则包括所有模块)
- 运行:
rm -rf .settings/ .project .classpath
删除 eclipse 项目文件,也从模块中删除 - 将您的项目作为现有的 Maven 项目导入
回答by asilchenko
Slightly different option usually works for me:
略有不同的选项通常对我有用:
- "mvn eclipse:eclipse" for this project in the command line.
- "Refresh/F5" this project in eclipse.
- 命令行中此项目的“mvn eclipse:eclipse”。
- 在 Eclipse 中“刷新/F5”这个项目。
That's all, no need to re-import but need to have the terminal window handy.
就是这样,不需要重新导入,但需要方便的终端窗口。