备份 Eclipse 插件和设置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4570160/
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
Backup Eclipse plugins and settings
提问by Martin Thurau
I'm using Eclipse and have plenty of plugins installed and configured to my needs. Is there any good way to backup these plugins and the configuration of them. I want to be able to replay these plugins in futures eclipse version (as long as they are compatible) and on different PCs.
我正在使用 Eclipse 并根据我的需要安装和配置了大量插件。有没有什么好的方法来备份这些插件和它们的配置。我希望能够在 futures eclipse 版本(只要它们兼容)和不同的 PC 上重播这些插件。
I know I could simply archive the whole eclipse/
folder, but I find this a little inelegant.
我知道我可以简单地归档整个eclipse/
文件夹,但我觉得这有点不雅。
采纳答案by Andrew Eisenberg
There are two parts to your question:
你的问题有两个部分:
- Copying your settings between Eclipse installs
- Copying your installed plugins between Eclipse installs
- 在 Eclipse 安装之间复制您的设置
- 在 Eclipse 安装之间复制已安装的插件
#1 is easy to do. You can export your Eclipse preferences from the File -> Export... -> Preferences. The resulting file contains all of your preferences for each installed plugin. It is portable between Eclipse installs and versions.
#1 很容易做到。您可以从 File -> Export... -> Preferences 导出您的 Eclipse 首选项。生成的文件包含您对每个已安装插件的所有首选项。它在 Eclipse 安装和版本之间是可移植的。
#2 is not really the "Eclipse" way of doing things. It is possible, but you need to structure your installed plugins differently. Rather than using the standard update manager to install your plugins, you can use the dropins folder. What you need to do is to copy every feature and plugin that you want to be shared across multiple installs into a zip file with the following structure:
#2 并不是真正的“Eclipse”做事方式。这是可能的,但您需要以不同的方式构建已安装的插件。您可以使用 dropins 文件夹,而不是使用标准更新管理器来安装插件。您需要做的是将您想要在多个安装中共享的每个功能和插件复制到具有以下结构的 zip 文件中:
eclipse/
features/
plugins/
Then you can unzip the file into the dropins folder of all the Eclipses that you want.
然后您可以将文件解压缩到您想要的所有 Eclipse 的 dropins 文件夹中。
More information on dropins: http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/p2_dropins_format.html
有关 dropins 的更多信息:http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/p2_dropins_format.html
回答by Kane
P2 installation replicationis a tool to help you backup installed plug-ins, you could install it via Eclipse Marketplace.
P2安装复制是一个帮助您备份已安装插件的工具,您可以通过Eclipse Marketplace安装它。
According to the settings of configuration, most of them are persisted in your workspace. So you could backup your workspace/.metadatafolder.
根据配置的设置,大部分都持久化在您的工作区中。所以你可以备份你的workspace/.metadata文件夹。
回答by Andrey Rodionov
I've made small service for myself to synchronize Eclipse settings. Currently it supports Java Templates + Bash Aliases. Could be useful for someone else.
我为自己做了一些小服务来同步 Eclipse 设置。目前它支持 Java 模板 + Bash 别名。可能对其他人有用。
回答by DwB
While inelegant, archiving the entire eclipse folder is also insufficient. I think you want to archive the following:
虽然不雅,归档整个 eclipse 文件夹也不够。我认为您要存档以下内容:
- The entire eclipse installation folder.
- The .metadata folder of every workspace.
- 整个eclipse安装文件夹。
- 每个工作区的 .metadata 文件夹。
By doing this, you will not only preserve the plugins and their settings, but you will also preserve an eclipse installation in which you know your plugins work.
通过这样做,您不仅将保留插件及其设置,而且还将保留您知道插件在其中工作的 eclipse 安装。