I've decided to use Ivy (http://ant.apache.org/ivy) in my projects instead of checking my dependency jars into source control.

My goals are as follows:
* Don't check in jars
* Allow multiple developers to work
* Snapshot versions for intra-module development (e.g. if I have a common jar, I want to be able to get the latest snapshot in my web project)
* Fast - I don't want this to slow me down

So I started by creating my own repository on a remote server. I created a user (ivy) and gave that user a public and private key. This key will be used to authenticate when pulling down jars. I'm using the ssh resolver (it's simple and I kind of understand what it's doing).

To load the jars, I used the ivy:install ant task. This was pretty annoying because I had to just throw a new target into my build.xml (the standalone Ivy tool does not support installing from one repo to another). I used http://mvnrepository.com to get the organisation, name, and rev data. Here's an example line from my build.xml file:

<ivy:install from="ibiblio" to="shared" transitive="false" overwrite="true" organisation="ehcache" module="ehcache" revision="0.9"/>

The install task basically creates the directory structure for you on the remote ivy repository. One could create the directory structure by hand (for a smaller project, I would just do that).

After all files are installed, I removed all ivy.xml, ivy.xml.md5, ivy.xml.sha1 files:

$ find /var/ivy/ -name ivy.xml -exec rm {} \;
$ find /var/ivy/ -name ivy.xml.md5 -exec rm {} \;
$ find /var/ivy/ -name ivy.xml.sha1 -exec rm {} \;

I got rid of these because when they were there, Ivy kept trying to download all dependencies for each project. As it is, I have all the jars I need, I don't need an ivy.xml file to tell my project to get more jars. Ivy works fine without the ivy.xml files (I read this somewhere).

NOTE: This post is incomplete. I do not have time to finish it right now. In a nutshell, here's what I did:

* Created my own repository (this is a must if you are doing any kind of serious development, IMHO)
* I had to edit/override the default chains and other things (I can't remember the names right now)
* I'm using Ant's buildnumber to create integration versions of jars

Powered by Drupal, an open source content management system

Navigation