清理Eclipse工作区元数据 [英] Clean out Eclipse workspace metadata
问题描述
我知道处理这个问题的唯一方法是创建一个新的工作区,导入项目从污染的工作区,重建我的所有设置(一个主要的痛苦),然后删除旧的工作区。有没有办法处理这个问题?
没有简单的方法从现有的工作区。使用干净参数不会真的有帮助,因为您引用的许多文件是自由格式数据,仅对不再可用的插件才知道。
<您最好的选择是优化重新导入,在此我想指出以下内容:
- 创建新工作区时您可以选择将某些设置从当前工作区复制到
- 您可以导出当前工作区的首选项(使用导出菜单),并在新的工作区中重新导入。
- Internet上有很多建议,只需复制
$ {old_workspace} /。metadata /。插件/ org.eclipse.core.runtime / .settings
文件夹从旧工作区到新工作区。这肯定是最快的方式,但它可能会导致奇怪的行为,因为您的一些插件可能依赖于这些设置,这些设置存储在其他地方的一些提到的自由格式数据。 (甚至有人将这些文件夹连接到多个工作空间,但是这真的需要在所有工作区上使用相同的插件。) - 您可能需要考虑使用比工作区首选项更多的项目特定设置在将来。因此,例如所有的Java编译器设置都可以在工作空间级别或项目级别设置。如果在项目级别设置,您可以将它们置于版本控制下,并且与工作空间无关。
I use multiple workspaces with Eclipse. I recently noticed that some of my workspaces have a lot of cruft in them from software packages that I installed and then later removed. As far as I can tell, the situation is that many packages write stuff (sometimes a lot of stuff) to the .metadata folder for every workspace I open while the package was installed. When I removed a package, it seems to clean out the .metadata folder for the workspace that I happen to have open at the time, but all the other workspaces are left with orphaned metadata. Sometimes this metadata causes problems—often, errors while opening the workspace and sometimes instability.
The only way I know to deal with this is to create a new workspace, import projects from the polluted workspace, reconstructing all my settings (a major pain) and then delete the old workspace. Is there an easier way to deal with this?
There is no easy way to remove the "outdated" stuff from an existing workspace. Using the "clean" parameter will not really help, as many of the files you refer to are "free form data", only known to the plugins that are no longer available.
Your best bet is to optimize the re-import, where I would like to point out the following:
- When creating a new workspace, you can already choose to have some settings being copied from the current to the new workspace.
- You can export the preferences of the current workspace (using the Export menu) and re-import them in the new workspace.
- There are lots of recommendations on the Internet to just copy the
${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings
folder from the old to the new workspace. This is surely the fastest way, but it may lead to weird behaviour, because some of your plugins may depend on these settings and on some of the mentioned "free form data" stored elsewhere. (There are even people symlinking these folders over multiple workspaces, but this really requires to use the same plugins on all workspaces.) - You may want to consider using more project specific settings than workspace preferences in the future. So for instance all the Java compiler settings can either be set on the workspace level or on the project level. If set on the project level, you can put them under version control and are independent of the workspace.
这篇关于清理Eclipse工作区元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!