我应该定期从 Eclipse 工作区中删除 .metadata 文件夹吗?会带来哪些问题?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7279992/
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
Should I regularly delete the .metadata folder from the Eclipse workspace? What problems will it cause?
提问by Anand
In my Eclipse workspace I've noticed the .metadata folder keeps growing. Should I regularly delete this folder? What would be the consequences of it?
在我的 Eclipse 工作区中,我注意到 .metadata 文件夹不断增长。我应该定期删除这个文件夹吗?它会带来什么后果?
Apart from that, what information does the .metadata folder contain?
除此之外,.metadata 文件夹包含哪些信息?
采纳答案by VonC
Deleting allthe .metadata
folder would remove all your project referencesfrom your workspace.
删除所有的.metadata
文件夹将删除所有项目引用从您的工作空间。
If your project is actually stored completely in the workspace (i.e. its sources are stored in the default workspace path), you would also lose your project contents as well - which is worse since you wouldn't be able to re-import them.
如果您的项目实际上完全存储在工作区中(即其源存储在默认工作区路径中),您也会丢失项目内容 - 更糟糕的是,您将无法重新导入它们。
I always recommend to keep your Eclipse project and its sources separate from the workspace.
See "What is "src" directory created by Eclipse?".
That way, the settings specific to your projects are saved within your project (in the .settings
directory), and not in the workspace.
Also, you need to move your launcher definitions in your project as well.
我始终建议将 Eclipse 项目及其源与工作区分开。
请参阅“ Eclipse 创建的“src”目录是什么?”。
这样,特定于您的项目的设置保存在您的项目中(在.settings
目录中),而不是在工作区中。
此外,您还需要在您的项目中移动您的启动器定义。
In that configuration, you can delete a workspace without much damage and simply re-import your project into a new workspace.
在该配置中,您可以删除工作区而不会造成太大损坏,只需将项目重新导入新工作区即可。