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:
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
And place them somewhere sensible. I used my workspace directory c:\development\development or perhaps the \eclipse\plugins\org.apache.ant_1.6.5\lib ANT lib directory inside my eclipse folder. 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.