Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintaining a common set of Eclipse preferences

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.

like image 537
Robert Munteanu Avatar asked Jun 04 '09 16:06

Robert Munteanu


People also ask

How do I set preferences in Eclipse?

To invoke this dialog, click on the Window menu and select the Preferences menu item. The preference pages are organized by category. You can locate a preference page by expanding the nodes of the tree in the left hand side of the dialog box.

How do I save my preferences in Eclipse?

Settings can be exported to a file using File -> Export -> Preferences, and you can import it to another Eclipse workspace.

Where are Eclipse preferences stored?

Preferences are stored in the workspace of your application in the . metadata/. plugins/org. eclipse.

What is Eclipse preference recorder?

The Workspace Mechanic Preference Recorder allows you to record any changes that you make to Eclipse's preferences over a period of time, and export those changes to a task file that can be used by the Workspace Mechanic.


Video Answer


1 Answers

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.

like image 64
VonC Avatar answered Oct 04 '22 07:10

VonC