Eclipse-Subversion-Subclipse
A quick tutorial on how to access a subversion repository using Eclipse, Subclipse, and JavaSVN.
Introduction
April 24 – 2005
Updated Oct 28, 2005 – A better guide is now available. I’m leaving this document here as the troubleshooting section at the bottom may still be useful to some people.
This guide will help you to get set up with Eclipse 3.0, Subversion and Subclipse. The main players are:
- Subversion – A relatively new source control system developed by tigris.org as a replacement for CVS (which is getting a little long in the tooth). It allows nice things like atomic operations and file moves without losing revision history.
- Eclipse 3.0 – This is one of the most popular open source IDE’s(Integrated Development Environment) out there. This will host the client that speaks to Subversion.
- Subclipse – An Eclipse plugin that allows you to access a subversion repository as a client. This plugin actually wraps the same library that the command line client uses.
- TMate.org JavaSVN – JavaSVN is a Java based subversion client library.
- Textdrive – A great webhost that is completely dedicated to subversion based development. If you are looking for a cheap place to host your project these guys are a good choice. I will base my server config part on their setup.
I am writing this using the most current (stable if possible) versions of all of these. My set-up is:
- Mac OS X 10.3.9
- Eclipse 3.0.2
- Subclipse 0.9.30
- JavaSVN Library 0.8.8.1
- JavaSVN Subclipse Extension 0.8.8.1
Setting up Eclipse:
Subclipse is the eclipse plugin to use subversion. The offical version is hosted here:
http://subclipse.tigris.org/update/
This version uses native calls to communicate with the client. There is an extension to the subclipse plugin that allows subeclipse to use an all-Java subversion client. This sounds a little better to me and I’ve had trouble trying to get the right svn client on my mac before so that’s what im trying. As of Subclipse release 0.9.33, JavaSVN is included with and supported directly in Subclipse. more information about this extension is here:
http://tmate.org/svn/
Adding this site to eclipse (Help->Software Updates->Find and Install) gives you the following install options (among others):
- Subclipse 0.9.30
- JavaSVN Library 0.8.8.1
- JavaSVN Subclipse Extension 0.8.8.1
Select these three extensions in the eclipse update manager and follow the instructions to get them installed. You will then probably have to restart eclipse.
Setting up your repository
Right now I only have documentation about setting up svn on Textdrive. You can try getting your squint on and watch Jason’s movie.
Troubleshooting:
Precondion Failed error – According to Alex from TMate.org this is what is going on:
Regarding the problem you have, I think it is related to your apache server
configuration.The following happens:
- JavaSVN sends HTTP request to the apache web server.
- Apache server evaluates HTTP header values and some of the headers looks suspicious from apache’s point of view.
- Apache web server respond’s with error 412 (prcond. failed), which means that there are some conditions to filter out suspicious requests and JavaSVN request didn’t pass those conditions.
So, if command line svn works with the same server, than there is something wrong with JavaSVN http headers. May be it is simply not listed in your server list of allowed “user-agents” or some header field is missing. In case when native svn works with your server I will add missing header and if your server just checks “user-agent” header than the “javasvn” probably should be included into the list of allowed agents.
The solution is to add a line to your .htaccess file in your public_html directory so that apache lets the request though. The following did it for me:
SecFilterSelective "HTTP_USER_AGENT" "JavaSVN" "allow,nolog"
Errors coming from eclipse on startup – I’m currently seeing errors like this when starting up eclipse:
org.tigris.subversion.svnclientadapter.SVNClientException: Command line client adapter is not available
I’m looking into it. Please drop me an email and let me know if you have seen this as well. SSH+SVN on Textdrive.com – Dont do it. It gets your permissions all wrong. Use https for secure connections instead of ssh. There is a thread about it.