Ivy-svn: An Ivy resolver for Subversion
Overview
Ivy is a dependency manager for Java which is based on Ant and can be integrated into Ant builds to allow for retrieval of artifacts (e.g. third-party jar files) which your project may depend on as well as publication of artifacts (e.g. your own .jar/.war/.ear files etc.) that your build generates. We have developed a custom Ivy dependency resolver (Ivy-svn) which uses Subversion for the storage of retrieved and published files (Subversion is not supported "out of the box" by Ivy itself). The key benefits of this resolver for existing Subversion users are:
- Everything is in one place - your source code, dependent libraries etc. are all kept in Subversion.
- No need to set up and maintain a separate HTTP/FTP/etc. repository.
- Being able to publish build artifacts to Subversion allows you to easily setup dependencies between different projects in Subversion.
- Less firewall and network configuration - can be used in environments where HTTP or other traffic is restricted but Subversion is allowed (e.g. build and testing machines).
Latest news
- Version 1.4 released (2008-03-19) - added optional "repositoryURL" attribute; third-party libraries bundled with binary version, replaced ganymed with trilead; compiled against Ivy 2.0.0 beta 2; updated to latest version of SVNKit; performance improvements. See CHANGELOG.txt in release for more information.
- Version 1.3 released (2008-01-08) - added support for more authentication protocols (Subversion User name and Password), compiled against Ivy 2.0.0 beta 1. See CHANGELOG.txt in release for more information.
- Version 1.2 released (2007-12-19) - added support for more authentication protocols (SSH Key File, Subversion User name, SSL certificate). See CHANGELOG.txt in release for more information.
Download
| Version | Release Date | Binary | Source |
| 1.4 | 2008-02-02 | ivysvnresolver-1.4-bin.tgz | ivysvnresolver-1.4-src.tgz |
| 1.3 | 2008-01-08 | ivysvnresolver-1.3-bin.tgz | ivysvnresolver-1.3-src.tgz |
| 1.2 | 2007-12-19 | ivysvnresolver-1.2-bin.tgz | ivysvnresolver-1.2-src.tgz |
| 1.1 | 2007-11-08 | ivysvnresolver-1.1-bin.tgz | ivysvnresolver-1.1-src.tgz |
| 1.0 | 2007-10-22 | ivysvnresolver-1.0-bin.tgz | ivysvnresolver-1.0-src.tgz |
Installation
- Copy all the third party libraries (Ivy, Trilead and SVNKit) from the "lib" folder to ANT_HOME/lib/ or to somewhere on your CLASSPATH. If you are upgrading from a previous version of Ivy-svn please remove any older versions of these libraries.
- Copy ivysvnresolver.jar into ANT_HOME/lib/ or make sure it is on your CLASSPATH.
- Create a standard ivy.xml file for your project declaring your dependencies, publications etc.
- Create an ivysettings.xml file containing a "svn" resolver element and set various properties on it as described below
- Remove the contents of your local ivy2 cache (this is located in ~/.ivy2 on Linux, remove the folder and all its contents).
- Remove ANT_HOME/lib/ganymed.jar and previous versions of Ivy jar files from ANT_HOME/lib/.
Configuration
- Create an ivysettings.xml file as described below, removing attributes and/or replacing words which are all uppercase with values that suit your setup.
<ivysettings> <typedef name="svn" classname="fm.last.ivy.plugins.svnresolver.SvnResolver"/> <resolvers> <svn name="ivysvn" username="${svn.user.name}" userpassword="${svn.user.password} keyfile="${ssh.keyfile}" port="${ssh.port}" passphrase="${ssh.keyfile.passphrase}" certfile="${ssl.certfile}" repositoryURL="PROTOCOL://HOSTNAME/PATH_TO_YOUR_SVN_ROOT"> <ivy pattern="PROTOCOL://HOSTNAME/PATH_TO_YOUR_IVY_REPOSITORY/[organisation]/[module]/[revision]/ivy.xml"/> <artifact pattern="PROTOCOL://HOSTNAME/PATH_TO_YOUR_IVY_REPOSITORY/[organisation]/[module]/[revision]/[artifact].[ext]"/> </svn> </resolvers> <settings defaultResolver="ivysvn" /> <modules> <module organisation="YOUR_ORGANISATION" name="ivysvnresolver" resolver="ivysvn"/> </modules> </ivysettings>For more information on this file refer to this. Make sure that this file is included in your Ant build file before you call any Ivy ant targets like ivy:retrieve, ivy:publish etc.<ivy:settings file="ivysettings.xml" />
- Remove, add and set attributes of the "svn" element to suit your environment as per the table below (we recommend setting them via
properties in your ant build file) and the above examples are coded accordingly.
Attribute Description Required name Name of the resolver Always username Subversion user name Always userpassword Subversion password For svn+ssh:// and http(s):// connections that require username and password authentication keyfile Path to SSH key file For svn+ssh:// connections that require username and keyfile authentication passphrase The SSH key file passphrase (if any) For svn+ssh:// connections that require username and keyfile authentication with a keyfile requiring a passphrase port The SSH port For svn+ssh:// connections where the SSH server is listening on a port other than 22 certfile Path to client side certificate file For https:// connections that require client side certificates for authentication repositoryURL A base repository URL (containing protocol, host and path to the root of the repository) If the root of the Subversion repository is located more than one directory level deep and you are using http(s)://
So an example ivysettings.xml for a Subversion repository accessed over SSH on the default SSH port using SSH username and password authentication would be:<ivysettings> <typedef name="svn" classname="fm.last.ivy.plugins.svnresolver.SvnResolver"/> <resolvers> <svn name="ivysvn" username="${svn.user.name}" userpassword="${svn.user.password}> <ivy pattern="svn+ssh://example.com/svn/someproject/[organisation]/[module]/[revision]/ivy.xml"/> <artifact pattern="svn+ssh://example.com/svn/someproject/[organisation]/[module]/[revision]/[artifact].[ext]"/> </svn> </resolvers> <settings defaultResolver="ivysvn" /> <modules> <module organisation="some_organisation" name="ivysvnresolver" resolver="ivysvn"/> </modules> </ivysettings>
Usage
Provided you have followed the installation and configuration steps above you should be able to publish and retrieve files to and from your Ivy Subversion repository using the standard Ivy Ant tasks. For retrieving you will obviously need to set up your own repository in Subversion and add files and folders containing whatever your projects depend on. For publishing you will need write access to the repository.Third party libraries
The Ivy Subversion resolver uses the following third-party libraries, the version numbers indicate the versions that the Ivy Subversion resolver was built and tested against, your mileage with other versions may vary.- Java 6.0
- Apache Ant 1.7.0
- Ivy 2.0 beta 2
- Trilead SSH for Java build 211
- SVNKit 1.1.6
Licensing
The Ivy Subversion resolver is available under an Apache v2.0 licenseFeedback
If you have any problems, questions, feature requests etc. feel free to e-mail adrian@last.fm.

