How to share Eclipse configuration over different workspaces
Asked Answered
U

11

145

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?

Unvarnished answered 16/1, 2010 at 18:34 Comment(3)
I had all kinds of problems sharing code in a single workspace using Dropbox. I would lean towards having multiple workspaces, one for each machine, and syncronize the group of workspaces using Dropbox.Cepheus
Old question I know, but for posterity, I found this blog post very useful: mcuoneclipse.wordpress.com/2012/04/04/… (It's not my post :-)Whine
There are always complications on Windows envs. Checking workspace settings into source control is not an answer. Source control settings are part of the workspace settings.Lateen
M
194

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.

Magnanimous answered 16/1, 2010 at 18:50 Comment(5)
I personally have those folders symlinked to dropbox and also RSE profiles are symlinked. Overall configuration of eclipse settings can be also exported from ideAltruistic
I'll start with this, but sadly there are many more settings outside of this directory that I'd like to synchronize.Jayejaylene
@DavidHarkness: please elaborate - which settings - where ? You might post an answer here - I am asking among others : "would it be safe and enough to hardlink the \.metadata\.plugins\org.eclipse.core.runtime\.settings directory ?" - to peakit : it's not as simple as that - the ${old_workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings contains also workspace settings and has other peculiarities - see my analysis hereRojas
To copy the folder use Robocopy: #473192Melson
To keep them in sync, consider Unison: cis.upenn.edu/~bcpierce/unisonDragoon
S
125

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.

Sciatica answered 29/7, 2012 at 4:5 Comment(3)
Works as well with Eclipse STS (spring Tool Suite) 3.4Killer
Worked on Eclipse LunaMannuela
Worked on Eclipse Neon.Consequently
A
9

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

Annal answered 13/6, 2016 at 21:49 Comment(3)
Yatta Profiles builds on Oomph/Eclipse Installer and makes sharing a bit easier.Calvities
@BernhardStadler Yatta does not transfer preferences.Feoff
Yatta can remember default preference values - workspace preferences can be recorded with Preference Recorder, and for project preferences you don't need any additional tools as you can add them to your SCM. The main intended use case one-click development workspace setup for teams with the goal of minimizing setup times, but synchronizing private profiles between different computers is also possible. I've never tried it myself but according to their web page, it is possibly to apply updates from online profiles, so it should be possible to use private online profiles as a sync mechanism.Calvities
H
7

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;
}
Hadj answered 27/6, 2012 at 13:41 Comment(1)
Actually that is what I wanted to do too (on windows) - but there are complications : see my answer hereRojas
P
4

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.

Prelusive answered 16/1, 2010 at 18:36 Comment(0)
I
4

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)

Inherent answered 6/1, 2017 at 0:39 Comment(4)
Is it really introduced in Neon? Is there a changelog/readme or some other info that confirms this?Hatchway
Typically developers have their own GIT repository and not shared, so then the list is: 1. [workspace]/.metadata/.plugins/org.eclipse.core.runtime/.settings - Except [workspace]/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs 2. [workspace]/.metadata/.plugins/org.eclipse.e4.workbenchBott
@TimoRiikonen Git wasn't in the question, so we have no idea what versioning system is utilized by the question's author. However, your comment probably would be useful to those who use Git, so you might simplify / clarify your comment a bit, perhaps even offer it as an answer, so it stands out, with the clarification it's intended for use with Git. Cheers!Inherent
@Hatchway I don't know if there's a changelog which mentions the Eclipse version which introduces the mentioned files to be copied. I mention "As of Neon (and possibly Mars)", as that's the version I was on, when answering this question, and I was moving between those versions, and that's relevant info (lest someone on another version become confused).Inherent
N
1

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.

Neumark answered 17/1, 2010 at 8:5 Comment(0)
T
1

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.

Triumph answered 30/11, 2010 at 19:42 Comment(0)
K
0

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

Kumler answered 27/3, 2017 at 22:15 Comment(0)
M
0

Simply copy the directories

${old_workspace}/.metadata/.plugins

from an existing project to the new one.

That worked well within (rather simple) PHP projects.

Mardis answered 26/10, 2017 at 17:48 Comment(0)
G
0

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

Grimona answered 4/1, 2019 at 15:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.