Topper Harley
Topper Harley

Reputation: 12384

Share all settings from all Eclipse workspaces

I'm developing applications that depend on libraries, under Eclipse (OS X). That makes the following:

I used to have only one workspace with projects A, B, C, L1, L2, L3, with the libraries usually a simple git clone from their repository.
I have then:

~/projects/ProjectA
~/projects/ProjectB
~/projects/ProjectC
~/projects/Lib1
~/projects/Lib2
~/projects/Lib3

That was working for some time, but now as projects A, B, C... are published and used, it can happen that projects may not use the same versions of libraries... and everything gets overcomplicated.

I had a look at working sets, but I don't think this is what I want.

I created a new workspace, and cloned libraries again so that I have:

~/projects/ProjectA/Project
~/projects/ProjectA/Lib1
~/projects/ProjectA/Lib2
~/projects/ProjectA/Lib3
~/projects/ProjectB
~/projects/ProjectC
~/projects/Lib1
~/projects/Lib2
~/projects/Lib3

So A's libs won't conflict with other copies used in B and C.

The problem is that the new workspace has the default settings, and all my perspectives, keyboard shortcuts and other stuff are gone.
I arranged my folder like that:

~/projects/EclipseSettings
~/projects/.metadata/.plugins/org.eclipse.core.runtime/.settings -> ~/projects/EclipseSettings
~/projects/ProjectA/.metadata/.plugins/org.eclipse.core.runtime/.settings -> ~/projects/EclipseSettings
~/projects/ProjectA/Project
~/projects/ProjectA/Lib1
~/projects/ProjectA/Lib2
~/projects/ProjectA/Lib3
~/projects/ProjectB
~/projects/ProjectC
~/projects/Lib1
~/projects/Lib2
~/projects/Lib3

As you can see I moved the .settings folder of my initial workspace to a new folder, EclipseSettings, and then symlinked the .settings of every workspace to that Eclipse settings folder.

Doesn't work.

For example, I have assigned command + M to SVN commit:

Why? Are there other files than org.eclipse.core.runtime/.settings that define my workspace?
Also, the perspectives are not there, the Java Formatter seems to be gone, it wasn't enabled in Save actions while I did enable it on my initial workspace...

I'm wondering if I should use that workspace thing to manage my projects, and also I'm wondering why I'm using Eclipse that uses workspaces/projects while IntelliJ seems to have a better way of managing everything. But I tried switching already and sticked to Eclipse.
Maybe I should give IntelliJ another chance, however I'd like to have some SO feedback on that first.

Upvotes: 0

Views: 370

Answers (1)

Bananeweizen
Bananeweizen

Reputation: 22080

Don't nest workspaces into each other. Otherwise changes in one of them will make the other go out of sync with the file system, causing much confusion the next time you open that workspace. Be aware that Eclipse manages its own state for resources in the workspace, that is not just a 1:1 copy of your file system.

Don't symlink (or otherwise) share the metadata folder. Many people have tried that , but is does not work. While much of the meta-information of the eclipse plugins are stored in the metadata folder, there is no requirement to do so. That's why many plugins also store some information in sub folders of your project, in hidden files and other places. As long as you cannot copy or symlink all that information also, just symlinking the metadata folder will lead to inconsistencies.

Use available tools instead:

  • When creating a new workspace, you are asked to copy settings from the current one. Do that!
  • Use Pulse, Yoxos, Workspace mechanic or another third party tool to have "profiles" for your workspaces and projects. You may want to search stackoverflow for those 3, to see that many other people also tried manual synchronisation without much success.

Upvotes: 2

Related Questions