如何在不同工作区共享 Eclipse 配置

发布于 2024-08-18 06:30:36 字数 157 浏览 3 评论 0原文

我在不同的机器上使用 Eclipse (PDT) 作为主要 IDE。 (比如在家、笔记本电脑、办公室等)。如何在多台计算机之间实用地共享 Eclipse 和项目配置?我应该对它们进行版本控制,还是有更简单的方法来做到这一点?

您如何确保所有计算机都使用相同的好旧配置,甚至是最新配置?

I'm using Eclipse (PDT) as primary IDE on different machines. (like at home, laptop, in office, etc.). How could I share the Eclipse and project configuration pragmatically between multiple computers? Should I version control them, or is there any easier way to do this?

How do you ensure to use the same good and old even so up to date config all of your computers?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

多孤肩上扛 2024-08-25 06:30:36

跨工作区共享 Eclipse 特定设置

  1. 转到 ${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings
  2. 复制上述目录下的所有内容到 ${new_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings

这将确保 ${new_workspace} 具有与 ${old_workspace} 相同的配置

如果出现任何问题,请更新。

Sharing eclipse specific settings across workspaces:

  1. Go to ${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings
  2. Copy everything under the above directory to ${new_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings

This is going to make sure that the ${new_workspace} is having the same configuration as the ${old_workspace}

Update in case of any issues.

弄潮 2024-08-25 06:30:36

另一个选项是导出/导入:

  1. 从现有工作区中,文件 -> 导出... -> 常规 -> 首选项,选中全部导出,然后选择将它们保存到的文件 (prefs.txt)。例如 epf)
  2. 在新工作区中启动 Eclipse,File->Import...->General->Preferences ,选择您的文件 (prefs.epf),选中 import all

效果很好对于本技巧的原作者:他导入了代码格式、代码样式、svn 存储库、jres 首选项。

编辑:在 Eclipse Juno 上这效果很差。某些首选项不会默默保留,例如保存操作。

Another option is export/import:

  1. From your existing workspace, File->Export...->General->Preferences, check Export all, and choose file to save them to (prefs.epf for example)
  2. Startup Eclipse in a new workspace, File->Import...->General->Preferences , choose your file (prefs.epf), check import all

That worked great for the original author of this tip: he had his code formatting, code style, svn repos, jres preferences imported.

Edit: On Eclipse Juno this works poorly. Some preferences silently do not carry over such as save actions.

巴黎盛开的樱花 2024-08-25 06:30:36

这是一个相对较新的项目,但看起来 Eclipse Oomph 正是出于这个原因而创建的。通过此工具,您可以创建可以与其他人共享的独特配置。我还没有使用它,但我计划:

https://projects.eclipse.org /projects/tools.oomph

It's a relatively new project, but it looks like Eclipse Oomph was created for exactly this reason. Through this tool you can create a unique configuration that can be shared with others. I have not used it (yet), but am planning to:

https://projects.eclipse.org/projects/tools.oomph

你爱我像她 2024-08-25 06:30:36

我必须同时处理多个工作区,并且每次创建新工作区时都需要设置很多首选项。我创建了一个模板工作区,并在该模板工作区中创建了所有必需的设置。每当我创建新工作区时,我都会创建 {new_workspace}/.metadata/.plugins/org.eclipse.core.runtime 的 simlink /.settings 指向 {template_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings。因此,当您在任何工作区中编辑任何首选项时,它将在所有其他工作区中复制。

我在 .profile 中创建了此函数别名,以便在创建新工作区后,我在命令提示符中运行此函数,并使用新工作区名称作为参数,以便创建链接。

function eclset(){
    present_dir=`pwd`;
    cd  {parent_to_workspace}/$1/.metadata/.plugins/org.eclipse.core.runtime ; 
    rm -rf .settings ; 
    ln -s {parent_to_workspace}/template/.metadata/.plugins/org.eclipse.core.runtime/.settings .settings;
    cd $present_dir;
}

I had to work on multiple workspaces simultaneously and there were a lot of preferences to be set each time I create a new workspace. I created a template workspace and created all the the required settings in that template workspace.Whenever I create a new workspace, I create a simlink of the {new_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings to point to {template_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings. So, when you edit any preference in any of the workspaces, it will be replicated across all other workspaces.

I created this function alias in my .profile so that once I create a new workspace, I run this function in my command prompt with my new workspace name as argument so that the link is created.

function eclset(){
    present_dir=`pwd`;
    cd  {parent_to_workspace}/$1/.metadata/.plugins/org.eclipse.core.runtime ; 
    rm -rf .settings ; 
    ln -s {parent_to_workspace}/template/.metadata/.plugins/org.eclipse.core.runtime/.settings .settings;
    cd $present_dir;
}
一身仙ぐ女味 2024-08-25 06:30:36

从 Eclipse Neon(可能还有 Mars)开始,您可以复制以下两个目录,以在不同的工作区之间共享工作台和设置/首选项:

    [workspace]/.metadata/.plugins/org.eclipse.core.runtime/.settings
    [workspace]/.metadata/.plugins/org.eclipse.e4.workbench

更新:这两个目录仍然存在于 Eclipse 2022-03 中(请注意版本命名的更改) ,来自与天文学相关的 YYYY-MM)

As of Eclipse Neon (and possibly Mars), you can copy the following two directories, to share your workbench and settings/preferences amongst your different workspaces:

    [workspace]/.metadata/.plugins/org.eclipse.core.runtime/.settings
    [workspace]/.metadata/.plugins/org.eclipse.e4.workbench

UPDATE: These two directories still exist in Eclipse 2022-03 (note the change in version naming, from astronomy-related to YYYY-MM)

蝶…霜飞 2024-08-25 06:30:36

您实际上可以设置许多项目特定的设置,这些设置可以签入源代码管理。对于小型项目来说,这非常有效。对于较大的项目,我们决定使用一个用于所有项目的文件,并签入一个单独的“资产”项目,该项目维护开发人员开始处理我们的项目所需的内容。这还包括许可证和其他所需文件等内容。

You can actually set many project specific settings that can be checked into source control. For small projects, this works really well. For larger projects, we decided to have a single file that we used for all of our projects and checked into a separate "assets" project that maintained things that developers needed to get started working on our project. This also included things like licenses and other required files.

虚拟世界 2024-08-25 06:30:36

这里有两个问题。首先,有项目定义、.project 文件和项目特定设置。就我个人而言,我喜欢源代码管理中的那些内容,因为它使检查项目和设置 IDE 变得更加容易。

其次,您有工作区设置。您会在这方面看到很多问题。我建议看一下 Pulse:它是一个增强的 Eclipse 发行版,除其他外,还可以保存您的工作区设置并将它们与多台机器或团队成员同步。

There are two questions here. First, there are project definitions, the .project files and project specific settings. Personally, I like those in my source control, as it makes checking out a project and setting up an IDE much easier.

Second, you have the workspace settings. You will see a lot of questions in this area. I suggest taking a look at Pulse: it is an enhanced Eclipse distribution that can, among other things, save your workspace settings and sync them with multiple machines or team members.

羞稚 2024-08-25 06:30:36

您还可以将 .prefs 文件从 ${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings 复制到项目根文件夹中名为 .settings 的文件夹中然后将其添加到 SVN(或 CVS 或...),

这样设置将在更新期间与源代码一起分发给所有开发人员。

You can also copy the .prefs files from ${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings to a folder called .settings in the root folder of your project and then add it to SVN (or CVS or ...)

That way the settings will get distributed to all developers along with the source code during an Update.

你穿错了嫁妆 2024-08-25 06:30:36

我有同样的问题。

我的方法:将项目数据存储在 owncloud 管理的目录中

项目 X 在工作站 A 上创建,自定义路径指向 my ownCloud 层次结构的新子目录。默认工作区仍然驻留在 A 的文件系统上。

当我坐在工作站 BI 上时,打开默认本地工作区(B 上的本地工作区)并使用“同步”ownCloud 目录中的现有源创建一个新项目。

每当您启动 Eclipse 时,只需单击“刷新”即可获得当前的项目数据。同步会自动在后台运行,因此在完成工作后请务必关闭 eclipse,并给 ownCloud 有机会将新文件上传到 ownCloud 服务器。

Tomcat 或其他服务器在本地运行,配置通过 scp 在计算机之间手动复制。仅当服务器设置发生更改时才会发生这种情况,但这种情况并不常见。

我使用 NEON 2 (arch linux) & 没有遇到兼容性问题。 NEON 3(下载一个在 Debian Stretch 上运行的版本)具有不同的 JDK。

此致
阿尔明

i had the same problem.

my approach: storing project data in a directory managed by owncloud

The Project X is created at workstation A, with a custom path pointing to a new sub directory of my ownCloud hierarchy. The default workspace is still residenting on the file system of A.

When I'm sitting at workstation B I open the default local workspace (local on B) and create a new project using the existing sources in the "synchronized" ownCloud directory.

Just click refresh any time you fire up eclipse and you have the current project data. Synchronisation runs in the background automagically, so take care when you have finished working to close eclipse and give ownCloud a chance for uploading the new files to the ownCloud server.

Tomcat or other Servers are running local, the config is copied manually between the machines via scp. This happens only if there are changes in the server setup, which is not very often.

I had no compatibility problems using NEON 2 (arch linux) & NEON 3 (download an running on debian stretch) with different JDK's yet.

Best regards
Armin

羁绊已千年 2024-08-25 06:30:36

只需将目录

${old_workspace}/.metadata/.plugins

从现有项目复制到新项目即可。

这在(相当简单的)PHP 项目中运行良好。

Simply copy the directories

${old_workspace}/.metadata/.plugins

from an existing project to the new one.

That worked well within (rather simple) PHP projects.

行雁书 2024-08-25 06:30:36

您可以使用 Eclipstyle 将一个工作区的首选项克隆到其他工作区。您还可以导出您的首选项并稍后克隆它们。

You can use Eclipstyle to clone preferences of one workspace to your other workspaces. You can also export your preferences and clone them later.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文