Maintaining a common set of Eclipse preferences

Robert Munteanu picture Robert Munteanu · Jun 4, 2009 · Viewed 11.2k times · Source

Whenever I switch workspaces/Eclipse installs I need to copy/redo the preferences:

  • compiler settings;
  • font sizes/families;
  • code formatter;
  • java code templates;
  • editor templates;
  • code clean-ups;

I would like to maintain these settings in an unitary way, preferrably under source control. How can I do that?


I know about 'copy settings' when creating a new workspace, but it does not keep updated copies.

Answer

VonC picture VonC · Jun 4, 2009

You could of course export/import those settings.

The other approach is to enable project specific settings for some settings.

http://www.peterfriese.de/wp-content/downloads/images/formatter_project_specific_settings.jpg

We have a very small Git repository with those kind of files:

http://www.mkyong.com/wp-content/uploads/2009/01/wicket-examples-7.jpg

  • .settings/org.eclipse.jdt.core.prefs (compiler problem settings and formatter rules)
  • .settings/org.eclipse.jdt.ui.pref (cleanup rules, common code templates)

The common settings are just copied/merged in each projects .settings directory, ensuring common rules amongst all projects, whatever the workspace.