1

I am working with Eclipse everyday, and I have a good 80 projects in my workspace, well organized.

We are using version control for our projects.

Every once in a while, we create a new branch.

I have to work on different branches everyday, so I like to keep them locally.

So basically, my file explorer looks like this :

- dev
  - eclipse_workspaces
    - workspace_16
    - workspace_17
    - workspace_trunk
  -source
    -trunk
      -project1
      -project2
      -....
    -branches
      -1.6 
        -project1
        -project2
        -....
      -1.7
        -project1
        -project2
        -....

Each workspace is set up to work with one of the branches. The main issue I have is that every time we create a new branch, I have to start my workspace over. Reconfigure all my settings, recreate my working sets, and reimport all my projects by hand.

It looks to me like it should be possible to "clone" an existing workspace, and just change the project's location from "C:/dev/source/trunk" to "C:/dev/source/branches/1.7" for example.

I found other solutions on how to do it for ONE project, but I basically want to do that for ALL my projects every time.

I also created a small java program to automate this idea, but without luck so far. On top of it, this solution would slowly get outdated as new projects use a different system, with tree files.

Has anyone ideas on how to "clone" a workspace, while only changing the location of the projects?

Community
  • 1
  • 1
jlengrand
  • 12,152
  • 14
  • 57
  • 87
  • 1
    Hm, changing between workspaces is always an issue. Some of the settings can be exported while others had to configured manually. Had you consider using working sets? So you can use the same workspace (in some cases this is not a working solution, e.g. when you do RCP and playing with different target platfroms, etc.). – rlegendi Sep 19 '14 at 07:00
  • We do use working sets. But I cannot import the same project (from trunk, and from a branch) in different working sets in the same workspace, because they have the same name and project files. – jlengrand Sep 19 '14 at 09:45
  • Oh, indeed! You're right, then consider my comment irrelevant :-) – rlegendi Sep 19 '14 at 15:46
  • @jlengrand: I have multiple Eclipse projects (from trunk, and from branches) in the same workspace without issues, I just suffix the project names with their branch name. Am I not understanding your case clearly? – Thomasleveil Sep 26 '14 at 23:29
  • @Thomas. Yes, I guess that could work in a way. Only thing is we have like 100 projects scattered on 4 svn repos. And the change from Kepler to Luna was rather bold for rcp projects. And the main reason is finally that I want to be able to have several eclipses open at the same time, one for 3.7 and one for our 4.0 branches for example. It looks to me like it should be easy. But maybe I am asking too much :). – jlengrand Sep 27 '14 at 09:24
  • @jlengrand maybe you should consider building a devbox as a VM image (Virtualbox?). You spend time installing eclipse and its settings and only one workspace and all projects from trunk. Then you clone the VM and relocate (the SVN way) your projects so in this 2nd VM your workspace is for one of your branches. Bonus: you can share the VM images with your team to get them up and ready in minutes – Thomasleveil Sep 27 '14 at 09:32
  • @Thomas. This would indeed achieve what I want. But such a hassle! I am baffled that there is no simple way to simply batch relocate projects in an eclipse workspace. – jlengrand Sep 27 '14 at 09:43

2 Answers2

2

I think you can use Workspace Mechanic for this.

Refer posts:

This solves:

Importing preferences on each and every new workspace.

Also in eclipse luna when switching workspace it ask whether to copy settings like workbench layout and working sets. select these options while switching workspace.

Look at Share / Export eclipse working sets.

Community
  • 1
  • 1
Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
  • Thanks for the long answer. Actually, settings are not that much of a problem. Simply copy pasting a whole workspace looks like a 'good' enough solution, since each developer has his own set of settings that he likes. My main issue so far is how to get "the same exact environment", where only the project's location has changed. I have tried to fiddle around with the .location files, but without success so far. Or maybe I missed part of what you say? Project import is the main pain for us now. – jlengrand Sep 24 '14 at 08:26
1

You can copy an existing workspace, delete its projects (the working sets will stay), and import all projects from the new branch in one step. The existing working sets will be empty, but you can adjust them on demand (only when you want to open it) with 'Edit Active Working Set...'.

Community
  • 1
  • 1