12/04/05
Using Subversion from the Internet with Eclipse -
Categories: Eclipse Platform, Subversion -
Serge Baccou
@ 10:52:37 am
In my previous note entitled Installing and using Subversion on Windows with Eclipse, I was concentrated on the installation of Subversion on my PC. The current note explains a better solution for collaborative development: using Subversion (aka SVN) from the Internet.
Benefits of using Subversion from the Internet
Here are the benefits of hosting the Subversion repository over having Subversion installed on your own PC (for collaborative projects of course):
- no need to bother with the installation of Subversion on your PC!
- your repository is available even if your PC is shutdown
- no need of a Dynamic DNS solution for your PC to be available on the net
- your provider may perform backups on a regular basis better than you
Subversion from the Internet
First thing you need is a web hosting provider that supports Subversion. I recommend TextDrive (see Why choosing TextDrive for more information). Once you have an account on such a provider, he will explain to you how to create a Subversion repository. Let assume that this repository is created. You can view it using such an URL: http://yourdomain.com/svn/repos.
Create a repository location under Eclipse
We assume that you have installed Subclipse, the Subversion plug-in for Eclipse. To create a repository location under Eclipse please follow these steps:
- Go in the SVN Repository Exploring perspective (Window | Open Perspective | Other | SVN Repository Exploring)
- In SVN Repository view, right click and choose New | Repository Location...
- In the Url field, enter
http://yourdomain.com/svn/repos - Enter your Subversion user and password and click on Finish
Create your repository layout
As explained in the famous book (available online) Version Control with Subversion, in the section Choosing a repository layout, you should create the following structure under your recently created repository location:

You can host many projects per Subversion repository. Thefore, you must first create a directory for your project (here it's named project1). Right click on http://yourdomain.com/svn/repos in the SVN Repository view and choose New | New remote folder.
Then, you must create three remote folder: branches, tags and trunk using the same menu on project1. The trunk is your main development branch. Branches will contain named development branches for the support of a delivered release for example. Tags will only contain named version that will not be changed, for example releases.
Create your Eclipse project from the Subversion repository
Now, it's time to create your Eclipse project from the Subversion repository. Be careful, you can only create a project from the trunk (main case) or from a particular branch in branches. Let assume you want to work in the trunk. Right click on trunk and choose "Check out" or "Check out as...". Using "Check out as...", you can tell Eclipse about the nature of your project, for example to tell Eclipse that your project is a Java project (very useful). Be careful, here check out as nothing to do with locking a file. Here, checkout means creating a working copy on your PC to work on your project stored remotely. Pick a name for your Eclipse project (project1-trunk is perfect for our example) and return to the Ressource Perspective (Window | Open Perspective | Resource). Your Eclipse project is now created!
Working with Subversion
The rest of the tasks are very intuitive. A lot of things are done using the Team menu in the Resource view: Add to Version Control, Commit, Update, Synchronize with Repository...
Creating a tag / a branch
When you are happy with your work, you can be willing to create a tag (or/and a branch). In the Resource Perspective, right click on the project and choose Team | Branch/Tag... In the Url, enter http://yourdomain.com/svn/repos/project1/tags/release-x.y.z where x.y.z is your release number.
That's all folks! Hope that this will help people to use Subversion with Eclipse using the Internet...
Comments:
No Comments for this post yet...
Leave a comment:
Pingbacks:
No Pingbacks for this post yet...