On a previous post Subversion, Ant and SVN task I talked about how to use the SVN ant task. However for this to work i had to install the svn client. So all of a sudden I have the svn command line, tortoise and subclipse (in eclipse) installed on my system. I rarely use the command line because the tortoise client is efficient and pretty easy to use.
To use svnant without having the svnclient installed in your system is kind of difficult.
With the help of the underlying svnClientAdapter, task uses JavaHL (a native JNI interface to the subversion api) if it can find the corresponding library (e.g. svnjavahl.dll on windows). Otherwise it uses svn command line interface.
So we need to find the native JNI interfaces. I had no idea which these were and even googling did not help. Until it struck me that the subeclipse must have the JNI interfaces because it was working on my colleagues workstation who did not have subversion installed in his system. A quick search through eclipse plugins and we had what we needed. In the eclipse\plugins\org.tigris.subversion.javahl.win32_1.0.2 directory there are the following eight dll files.
These have dependencies about which we had no idea. So we copied all of them and placed them in the ant lib directory.
Now we set the javahl=”true” for the ant task and viola it works. Nice no, easy no way, but if you really want to run svn from ant then this is the way to go I guess. How to install subclipse in eclipse to get the dll files?
Link to Javahl – courtesy Thomas