views:

2407

answers:

5

I enjoy using Netbeans, especially for development with Maven, however, I've found recently that I've been working with three different branches of the same code base in different parts of the development cycle.

One of the things that Eclipse can do, is separate the projects into different workspaces, so i can simply start Eclipse with the workspace containing my Maven projects in the production patch branch or the trunk depending upon what I need to be working on.

I'd love to accomplish this in Netbeans, but haven't found a way to do so. Any ideas?

A: 

Netbean's equivalent is the "Project." In your project explorer you can right click on the current project and close it. Then go to File | Open Project and select a different branch. You will have to create a new project from each branch of your code.

mtruesdell
Not sure that is going to help as I would prefer to not have to have 3 groups of 6 projects (18 total) cluttering up the workspace with the same name in groups of 3. Know what I mean?
Mike Cornell
+5  A: 

I've found two things:

First there is a "similar" feature. It involves using the userdir switch on the command line. The downside being you would need to restart your IDE rather than switching while open. I think I can live with that for the time being. I found the technique here for Windows:

  1. Create a shortcut on your desktop to the Netbeans executable: C:\Program Files\NetBeans x.x\bin\netbeans.exe
  2. Right-click on the shortcut and click "Properties".
  3. In the "Target" textbox, add the extra parameter to the very end: --userdir C:\path\to\new_workspace
  4. Click "OK" to exit the Properties window and double click the shortcut. Netbeans will launch and create/load the workspace at that location

Secondly, someone has submitted a feature to allow for workspace switching (or in this case userdir switching) from the IDE itself. Perhaps this will be rolled into 7.0.

Mike Cornell
Regarding your downside: switching workspaces in Eclipse isn't too different to restarting Eclipse.
Joachim Sauer
For even better independence, you can use -J-Duser.home=C:\path\to\new_workspace instead of --userdir.
Damien B
@Mike Great workaround. @Damien It is not working if I use -J-Duser.home
RaviG
+1  A: 

Well Netbeans has a group so you can create a group of projects which you want to say put in a eclipse workspace otherwise.

So when you switch a group it's like switching workpsace in eclipse

narup
+2  A: 

I am using mac os with version 6.7.1.

There is the option of project group.

from File > Project group.

in here you can create a project group based on a folder location, so any projects underneath this folder will be considered within this project group.

When scwitched betwee project groups only projects within are displayed, and it maintanes the current status of opened files ..etc.

Switching between project groups doesn't require closing the IDE.

Given those options I believe this would be equivalent to the workspace switching in eclipse.

MS
A: 

Neither projects or project groups do not work in a similar way as an Eclipse workspace (yet) as far as I know. When switching workspaces in Eclipse, all the files opened will be closed and the ones in the new project will be opened. In this way, all projects work as one entity. The netbeans project/project groups do not work in that way. I hope there will be such a feature soon cause that really helps if you have many windows open and you switch between projects

Samuel