26

Having a bit of a problem,

Due to the source-control set-up we use, each bug/enhancement is worked on in a new branch. This is fine, but when in Eclipse, we need to set-up a new project for every branch.

Is there any way of easily setting up default preferences for a project, or importing/exporting project preferences within Eclipse?

Thanks,

Stuart

Spedge
  • 1,668
  • 1
  • 19
  • 36

4 Answers4

28

One possible solution would be to store those common preferences at the workspace level for Eclipse (see Manage your Eclipse environment article)

The downside of having multiple workspaces is the need to share development preferences among them.
Since preferences are persisted on a workspace basis within Eclipse, you have to export your workspace preferences and import them to your desired workspaces (File > Export > Preferences).

Even if you stay in the same workspace (with several projects), you can share common settings with other developers by exporting those workspace preferences.

settings

As mentioned by Fabian, the project specific settings are in .classpath and .project, but he left out .settings:

.settings are for IDE project-specific settings like compiler warnings and so on.
It you want to share project-specific IDE-related settings, just copy the .settings directory from project directory to project directory.

Tips: copy your project launcher (created by default in <workspace>\.metadata\.plugins\org.eclipse.debug.core\.launches) into your .settings directory: that way, you will also share your custom project launchers.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
3

The above methods might work in some settings but do not address the problem of exporting a single project from your workspace including its properties for use by another person.

One way of doing this is to export the project folder as a zip archive as described above but also save the following file from your workspace: .metadata/.plugins/org.eclipse.core.resources/.projects/MYPROJECT/.indexes/properties.index where MYPROJECT is your project name.

If you then import the project as a new project in a different workspace you can afterwards copy this file into your new workspace metadata and you will have the original project properties.

  • Interesting and more specific than my answer. +1 – VonC Feb 18 '13 at 18:03
  • +1 for possibly helping me find the final key in the puzzle of 1-step config copying between workspaces that are just different versions of the same app which for some reason we can't just handle via named branches in version control. – Erik Reppen Jun 20 '13 at 16:33
1

The project-specific settings (contrary to the already mentioned workspace-specific settings) are stored in two hidden files in the project: .classpath and .project, which you might be able to reuse to setup your projects.

Community
  • 1
  • 1
Fabian Steeg
  • 44,988
  • 7
  • 85
  • 112
0

Have a look at Workspace Mechanic

KrishPrabakar
  • 2,824
  • 2
  • 31
  • 44