Java Eclipse 错误:此项目需要迁移 WTP 元数据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/503157/
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
Eclipse error: This project needs to migrate WTP metadata
提问by larf311
We started a Web Project in Eclipse 3.2 a ways back and we've since upgraded to Eclipse 3.4 but now the Project has the error:
我们在 Eclipse 3.2 中启动了一个 Web 项目,我们已经升级到 Eclipse 3.4,但现在该项目出现错误:
"This project needs to migrate WTP metadata"
“这个项目需要迁移WTP元数据”
We've tried right-clicking and doing the "quick-fix" which is in fact to Migrate WTP Metadata. Unfortunately nothing happens and the error remains.
我们尝试过右键单击并执行“快速修复”,这实际上是为了迁移 WTP 元数据。不幸的是没有任何反应,错误仍然存在。
We can delete that error from the Problems and everything works as it should, however, every time we re-import the project from source control, the error re-appears. Any ideas on how to permanently get rid of this error or how to ACTUALLY migrate WTP metadata?
我们可以从问题中删除该错误,一切正常,但是,每次我们从源代码管理重新导入项目时,错误都会重新出现。关于如何永久摆脱此错误或如何实际迁移 WTP 元数据的任何想法?
UPDATE:Everyone, please vote on the answer that works for you rather than adding your own answer that references a previous person's answer.
更新:每个人,请对适合您的答案进行投票,而不是添加您自己的参考前人答案的答案。
采纳答案by Nuts
The above solution works fine but it creeps up again and again. An easier solution is to right click on the concerned project in Eclipse and choose Validate.
上述解决方案工作正常,但它一次又一次地爬行。一个更简单的解决方案是在 Eclipse 中右键单击相关项目并选择 Validate。
回答by VonC
try adding this line in the .projectfile
尝试在.project文件中添加这一行
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
Or refer to this discussion: for instance, make sure there is no duplicate entries in .sessions/org.eclipse.wst.common.component
或者参考这个讨论:例如,确保没有重复的条目.sessions/org.eclipse.wst.common.component
As noted in the comment by larf311, the actual answer in this instance was:
正如larf311在评论中所指出的,这种情况下的实际答案是:
delete the "
.settings/org.eclipse.wst.common.component" file.
删除“
.settings/org.eclipse.wst.common.component”文件。
Simple. ;)
简单的。;)
回答by Milan
For me, none of these worked. The solution for me was deleting the following file while Eclipse was stopped:
对我来说,这些都没有用。我的解决方案是在 Eclipse 停止时删除以下文件:
/workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/myprojectname/.markers
回答by Michael Lamb
Removing the .markers file resolved this issue for me. I would upvote that solution, except that I don't have the "reputation" to do so. :(
删除 .markers 文件为我解决了这个问题。我会赞成该解决方案,但我没有这样做的“声誉”。:(
回答by Michael Lamb
Delete the project, and check it out of source control
删除项目,并将其从源代码管理中检出
回答by marius
Here is another thing you could try, only this worked for me :(
这是您可以尝试的另一件事,只有这对我有用:(
Go to project properties > Project facets > there tick "Java" and "Utility Module" ... apply This works if your project is referenced from other projects ..otherwise you could play with those options ...see which one works for you.
转到项目属性> 项目方面> 勾选“Java”和“实用程序模块”...应用 如果您的项目是从其他项目引用的,这有效...否则您可以使用这些选项...看看哪个适合您.
回答by Cesar Olvera
I use SVN and every time I checkout the project in a new computer I have this problem, the way I fixed is to copy the .settings from the original location to the new folder of the project, of course use validation
我使用SVN,每次我在新计算机上签出项目时都会遇到这个问题,我修复的方法是将.settings从原始位置复制到项目的新文件夹中,当然使用验证
回答by mortsahl
Use maven ... mvn eclipse:clean ... mvn eclipse:eclipse ... reimport the project
使用 maven ... mvn eclipse:clean ... mvn eclipse:eclipse ... 重新导入项目
回答by Moataz Elmasry
This just means that the project configuration of wtp are old, or there's a conflict between modules. go to Projct ->properties -> project facets. Then click the following: dynamic web project ver 2.5, java 5 or 6 and javascript toolkit (not sure if its necessary). You will notice that there have been changes to .settings file. check in the new changes, and everytime someone checks out the project it should be okay
这只是说明wtp的项目配置旧了,或者模块之间存在冲突。转到项目 -> 属性 -> 项目方面。然后单击以下内容:dynamic web project ver 2.5, java 5 or 6 and javascript toolkit(不确定是否需要)。您会注意到 .settings 文件发生了变化。签入新的更改,每次有人签出项目时应该没问题
回答by april26
In the Properties for the project I selected Project Facets. None were selected, but there was a message on the right hand side indicating that Java 1.3 or later needed to be selected. I selected Java 6 and then after closing the Properties window I still had to do a "Validate". The problem finally disappeared.
在项目的属性中,我选择了 Project Facets。没有选择,但右侧有一条消息,指示需要选择 Java 1.3 或更高版本。我选择了 Java 6,然后在关闭“属性”窗口后,我仍然必须执行“验证”。问题终于消失了。

