Reputation: 6947
I have two copies of the same directory structure (basically, trunk and a feature branch) which both contain a Java project (call it ProjectX) in a subdirectory of the respective base directory.
I have painstakenly set up Eclipse the way I want it to work with regards to settings, colors etc.
Now, I want to be able to switch between working in either trunk\ProjectX or featurebranch\ProjectX. These are completely separate on disk (which is why I feel that the accepted answer to How to create multiple projects with same name in Eclipse? does not address my concern), but since they share the name ProjectX on disk, Eclipse doesn't seem to want to let me add them to the same workspace.
Working sets don't help me because the projects are not (yet) in the same workspace.
Removing and re-adding the projects very quickly becomes error-prone.
Making a copy of the workspace directory and opening that seemed to lose quite a few of my settings (colors, servers, etc.) (why that is is another interesting question) and as far as I could tell, there was no easy way to tell which workspace I am actually working in right now.
My question: What is the recommended way to deal with a situation like this?
I guess I am hoping for some way to define an alias of some kind, such that I can add trunk\ProjectX as TrunkProjectX and featurebranch\ProjectX as FbProjectX, then use working sets to switch between them.
Upvotes: 20
Views: 16581
Reputation: 597
For maven projects, that have same name use Advanced->Name templates (I prefer groupId.artifactId) while importing them into the same workspace
For eclipse projects, edit .project file and change <name> under <projectDescription>
Upvotes: 2
Reputation: 48634
The project name is just a string in the .project
file, so you could edit the file outside Eclipse before opening the project in Eclipse.
Upvotes: 0
Reputation: 442
I've used the following process, and it's worked for me:
Import both projects using the following steps:
Upvotes: 1
Reputation: 18704
Eclipse has a showlocation
parameter:
eclipse.exe -showlocation
This will show the location of the workspace in the title bar.
I use an extra workspace for each branch. That way I feel secure, that I don't accidentally forget something and change trunk instead of branch.
Upvotes: 7