Accessing Subversion Using SvnAnt and JavaHL
Over the years, I've spent a lot of time with Ant and Subversion while using SvnAnt to make the pair sing in perfect harmony. In the past, though, I've always had the Subversion client installed so SvnAnt just used that to communicate with my repositories. Why not? It's convenient.
I recently had occasion to install the happy trio again, however, and I decided to unclutter my file system by not installing the Subversion client. I rarely use the command line client anymore in favor of TortoiseSVN, so there was no compelling reason to install it. Instead, I decided I'd use the JavaHL library to connect to Subversion. SvnAnt supports that connection method so I figured it would be relatively painless.
Um, no.
SvnAnt bundles the JavaHL library itself in a file named svnjavahl.jar, but it doesn't include the glue that makes it all stick together in a meaningful way - javahl.dll. Not only isn't the dll file included, but it's not easy to find and download. In fact, the only way I found to get my hands on it was to install Subclipse - a plugin that I don't need or use for the Eclipse IDE (which I do use). After that, I had to copy the files I needed - javahl.dll and its far-too-many dependencies (DLL Hell, anyone?) - to somewhere in my %PATH% before I was finally able to export from Subversion using SvnAnt.
Installing Subclipse was pretty easy. There are easy-to-follow instructions on the Subclipse project site complete with a lot of visual aids (read: screenshots). Once I had Subclipse installed, I needed to copy the following files from <eclipse root>\plugins\org.tigris.subversion.javahl.win32_1.2.2\:
- libsvnjavahl-1.dll
- intl3_svn.dll
- libeay32.dll
- ssleay32.dll
- libapr.dll
- libaprutil.dll
- libapriconv.dll
- libdb44.dll
Whew. That took a while. I didn't know what the dependencies were (or even that there were any, really) so I had to try to execute my build after each file was copied and see what failed next. I copied all of the required files to %ANT_HOME%/bin for convenience, but anywhere in your %PATH% will work just fine. After copying all eight files, my build finally ran and happily went about its job of exporting my fileset from Subversion.
Now that I have this working, I think I'll do a bit more decluttering and remove Subclipse. There has to be a better way to do this, but even after some fairly extensive quality time with Google I sure couldn't find it. In lieu of a more, um, obvious method, this path at least got the job done.





Loading....