I've been working with eclipse and SVN for many years in teams from a single developer up to 12 and I always was the one to setup our folder structure. I managed to get it working somehow, but I feel that my folder layout is far from optimal. It's hard to tell what my typical folder layout looked like, because it looked very different each time.
I'm just starting another big project now, and I want to do it the professional way this time.
Those are the facts right now:
I'm alway unsure wether to commit those files generated by eclipse (like ''.project'' and ''.classpath''). In prior projects, sometimes we put them into the SVN, sometimes we didn't, and both approaches had ther pros and cons. Once, we even committed the whole workspace, but that seemed to be a bad idea.
One key concept that I'm certainly missing is how Eclipse handles its workspace. By default, the whole project lies inside the workspace-folder, but there can be projects that are external, which are linked in some magic manner I just don't understand.
I'm unsure how to layout the project locally and on the repository. I think there are three possibilities:
A dummy folder structure, maybe something like that (do I just answer my own question?):
Along with a hint what to checkout where, like that:
And some guidlines like
#1) Right-click on the project folder in the project explorer, and click on Team -> Share. #2) In the following window, select SVN and click next. #3) The next window will ask you for your SVN repository URL and credentials, enter that and click finish to add and commit.
Synchronize with Repository is something similar to svn status -u , but even more. It will open a Synchronize tab (or perspective) that displays overview of your local (outgoing) modifications versus repository (incoming) modifications.
Workspaces and repositories shouldn't be related.
The workspace is really just where Eclipse stores a bunch of settings. Project files can (and usually do) live in the workspace, but as you know, they can be imported from an external source--the import is just a logical link.
You can create as many workspaces as you want for specific purposes; you could even import projects in one workspace into another if you had reason to do so.
The SVN layout should be separate from how your workspace is defined. They may end up looking similar, but that shouldn't imply that they're actually the same. I'd recommend each Eclipse project have its own SVN project, so that instead of having
you have
What this does for you is give you the flexibility to lay out your workspace completely separate from how your repository is structured. You'll be able to check out individual projects into the workspace without having to checkout the entire codebase. You'll be able to have projects checked out on development branches while others are on the trunk, you can revert changes to one project while leaving another alone and so forth.
The last question about which artifacts to check into SVN is a matter of taste. I'd recommend checking in whatever artifacts are universal across the development team. If Eclipse is the standard IDE, go ahead and check in the .project and .classpath files so that a new developer will be able to checkout and build immediately. If certain plugins are universal and have config files of their own, go ahead and check those in as well. On the other hand, anything that isn't shared across the dev team should be left out of the repository.
Hope this helps.
EDIT
Further experience has taught me that the only things that should go into source control are the actual source files. Configuration and setup files should be regenerated by the developer when setting up a new project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With