Ayusman
Ayusman

Reputation: 8719

common workspace setup in eclipse

I want to create several workspaces which point to different branches of a codebase. The problem I am facing is every time I need to create a new workspace I have to do the same configuration for each workspace.

Example:

  1. Setting up tomcat configuration and it's related java options such as library and java agent settings.
  2. A system variable that points to specific folder containg my jar files.
  3. Another system variable

Questions:

  1. is it possible to have these setups done once so that all subsequent workspaces do not need to be configured?
  2. is it possible to export these preferences and import later into any workspace either on my machine or other machine?

System information:
Windows 7, Eclipse 3.5, Sysdeo tomcat plugin, Tomcat 6

Upvotes: 1

Views: 1369

Answers (1)

Ashutosh Jindal
Ashutosh Jindal

Reputation: 18869

While eclipse does have an Export preferences option, it does not export everything and specifically it is not comprehensive enough for workspace duplication.

In the past I have had a lot of success just cloning the physical workspace folder itself.

For example, let's say you have setup the workspace with everything that you want in it. To duplicate it, find out the path of the current workspace folder by going to File -> Switch workspace -> Other. The path shown here in the dialogue that pops up is the current workspace path ( don't press ok yet)

Create a copy of this folder. Now to use this copy, just use it in the above dialogue, i.e., go to File -> Switch workspace -> Other and put in the path of the copy. Press OK and Eclipse shall restart with the new workspace. Now the only thing you will have to do is point the code to a different branch. Rest all the settings should be present already.

This works specially well on the same machine. If you copy this workspace folder it should still work but your mileage may vary.

Upvotes: 2

Related Questions