33

I have created a couple of java working sets for a project in my workspace and want to share them with other people (using different workspaces). Is there a way to export them?

blue-sky
  • 51,962
  • 152
  • 427
  • 752
Mark Pope
  • 11,244
  • 10
  • 49
  • 59
  • 1
    You don't need any plugins, the Team Project Set feature works perfectly with Kepler. See this answer: http://stackoverflow.com/a/22182813/768935 – allprog Mar 04 '14 at 20:57

4 Answers4

20

You can try and export (as in "copy to another people workspace metadata directory"):

</path/to/.metadata>\.plugins\org.eclipse.ui.workbench\workingsets.xml

This is the file referencing your working sets.


z0r adds in the comments:

my team mate replaced his workingsets.xml with my version of the file, and it worked well.
However, you must exit Eclipse before replacing the file, because Eclipse will overwrite it with the old version when it exits.
I think you only need to do this once.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Can someone else working on the project then import that file somehow? – Mark Pope Mar 03 '10 at 09:33
  • @Scobal: someone else can work, then copy that file in his workspace (and restart Eclipse). But if he had defined its own working sets, that means he needs to *merge* your file in his in order to not override its own current working sets. – VonC Mar 03 '10 at 09:43
  • 1
    I'm hoping there's a way to check that file into svn and from a clean checkout just import the working sets file (rather than having to copy it into a workspace), which in turn brings in the referenced projects. – Mark Pope Mar 03 '10 at 09:50
  • @Scobal: I agree, but right now, I didn't find a clean way to do an export/import. I would be curious to know if copying that file in another workspace works though. – VonC Mar 03 '10 at 09:55
  • @VonC I just tried it: my team mate replaced his `workingsets.xml` with my version of the file, and it worked well. However, you must exit Eclipse before replacing the file, because Eclipse will overwrite it with the old version when it exits. I think you only need to do this once. – z0r Jun 20 '13 at 00:38
  • 1
    @z0r interesting. I have included your comment in the answer for more visibility. – VonC Jun 20 '13 at 07:30
  • Using the Team Project Set function is much safer. – allprog Mar 04 '14 at 20:58
18

download the AnyEdit addon:

Description | Download page

and then use the following work through:

  1. Via the menu bar: File > “Export…”
  2. Select “General” / “Working Sets”
  3. Click “Next >”
  4. Select the working set(s) you want to export and where you want to export the file.
  5. Click “Finish” to perform the export.

sample

Sk8erPeter
  • 6,899
  • 9
  • 48
  • 67
Phil Rykoff
  • 11,999
  • 3
  • 39
  • 63
  • 4
    @henchman - I found that website before asking my question here. I don't see an option for "Working Sets" under "General" – Mark Pope Mar 11 '10 at 11:28
  • sadly only the project names/IDs are exported. If the projects aren't yet imported, the working set stays empty – hardmooth Aug 04 '17 at 11:47
  • This plugin is now in the marketplace (AnyEdit Tools: https://marketplace.eclipse.org/content/anyedit-tools) – Edu Castrillon Nov 30 '22 at 08:23
15

In Eclipse Indigo the working sets export has moved to Export -> Team Project Set and there is a check box top left to export working sets.

Peter
  • 151
  • 1
  • 2
  • 1
    Hmmm.. doesn't work well for me -- I get to the last page of the export screen and there is no option to export, all the buttons are just grayed out (I've selected everything, of course). – BrainSlugs83 Oct 13 '14 at 09:10
  • 1
    This seems to work on only team projects (ones that have been shared CSV and GIT) – Danny Oct 30 '14 at 16:11
  • @Danny: I wrote an Eclipse External Tool configuration to export your workspace's working sets. See [my answer below](http://stackoverflow.com/a/34021244/1762224). – Mr. Polywhirl Dec 01 '15 at 13:13
0

Although, FileExportTeamTeam Project Set is the correct way to export working sets, you could write an Eclipse External Tool.

screenshot

External Tools

  1. Open a new dialog by navigating:

    RunExternal ToolsExternal Tools Configurations…

  2. Select Program and click the New button to create a new configuration.

    Note: You will only need to use the "Main" tab.

  3. Give the tool a title e.g. "Export Working Sets"

    Windows

    • Location: ${env_var:SystemRoot}\System32\cmd.exe
    • Working Directory: ${env_var:USERPROFILE}\Documents
    • Arguments:  

      /c copy /y ${workspace_loc}\.metadata\.plugins\org.eclipse.ui.workbench\workingsets.xml workingsets-${current_date}.xml
      

    Linux

    • Location: /bin/cp
    • Working Directory: ${env_var:HOME}/Documents
    • Arguments:  

      ${workspace_loc}/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml workingsets-${current_date}.xml
      
Mr. Polywhirl
  • 42,981
  • 12
  • 84
  • 132