Installing SVNAnt into Eclipse
On my road of exploration for ANT, and the end goal of using it for deployment, I have had to tackle how to get files out of SVN ready for moving to a server. This means getting ANT to run the equivalent of an svn export from the command line.
This is possible using the command line client through ANT thus:
<arg line="co ${svn.projecturl} ${build.temp} -r ${svn.revision} --username ${svn.username} --password ${svn.password}"/>
</exec>
However there is a nicer way that doesn't involve installing the SVN command line client. Enter SvnAnt.
To install it download the latest stable build, I have used the svnant-1.0.0.zip. Take the jar files
- svnant.jar
- svnClientAdapter.jar
- svnjavahl.jar
Once you have placed your jar files, you need to get Eclipse to load them at runtime. I read somewhere that using the ANT folder above and a simple restart would have Eclipse pick them up, but that didnt work for me.
- Open Eclipse
- Window > Preferences
- Ant > Runtime
- Ant Home Entries (Default)
- Click Add External JARs
- Navigate to c:\development\workspace or wherever you unzipped the jar files
- Select the 3 .jar files
- Open > Apply > OK
- Restart Eclipse
You should now be able to run the svn tasks. Here is an example to update a local working copy.
<echo message="updating working copy at ${svn.wc}" />
<svn username="username" password="password">
<update dir="c:\development\testrepo\"/>
</svn>


Following this posting I get the error "Cannot use javahl nor command line svn client".
Any thoughts what I've done wrong?
You can check what your path is by doing:
System.out.println(System.getProperty("java.library.path"));
after you change your path, you may need to reboot because windows is stupid.