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.
Repeating myself.
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.
http://subclipse.tigris.org/svnant/svn.html
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.
- intl3_svn.dll
- libapr.dll
- libapriconv.dll
- libaprutil.dll
- libdb43.dll
- libeay32.dll
- libsvnjavahl-1.dll
- ssleay32.dll
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
August 10th, 2007 at 9:39 am
I copied the DLL files to ant\bin as it is already in PATH. I put the svnant.jar, svnClientAdapter.jar and svnjavahl.jar to ant\lib so that I don’t have to specify a custom classpath.
September 5th, 2007 at 5:02 pm
JavaHL is available as a separate download from the Subversion project. http://subversion.tigris.org
September 6th, 2007 at 2:52 am
Thanks Nathan but could you please say which download is it exactly?
I went to the Downloads page but could not find it.
October 9th, 2007 at 7:01 pm
As of Oct 9th, the url for the separate download of javahl is:
http://subversion.tigris.org/downloads/1.4.5-win32/apache-2.2/svn-win32-1.4.5_javahl.zip
October 11th, 2007 at 2:13 am
awesome thanks Thomas
May 15th, 2008 at 6:30 pm
Thanks for the info!
Been looking for 2 days and I finally got svnant working now!
June 19th, 2008 at 8:02 am
Somehow i missed the point. Probably lost in translation
Anyway … nice blog to visit.
cheers, Amorphous.
July 31st, 2008 at 8:32 am
how can i “set the javahl=”true” for the ant task” ??
please hurry
July 31st, 2008 at 11:39 am
HI Rafal
you can use the ant block
just take a look at http://deadmanwalking.wordpress.com/2007/07/12/subversion-ant-and-svn-task/
February 22nd, 2010 at 8:46 pm
if you use svnkit=true all you need is jar files
no dlls no svn client
what are you talking about?