20051007

Forget Maven, jpackage.org and Ivy - use HttpUnit!

With a 24k jar, 4 lines of xml you get the jars you need in a classpath of your ant script - job done. The HttpUnit team have a little known ant extension that does the 'maven download' thing very well. It is so little known that it is easier to find it from the Ivy site than the HttpUnit site.
http://www.httpunit.org/doc/dependencies.html

I suppose that it is a little unfair on the 'dependency management' tools to compare them to something as simple as a Maven aware downloader. But the problem with all of the dm tools is their habit of being dependant on things not in their respective repositories.

HttpUnit's ant-dependencies tool avoids that issue by not bothering with the minefield of inter-jar dependencies, and simply concentrating on search, version resolution and caching. Ant has built in process dependency management: e.g. <target name="hibernate-download" depends="c3p0-download">... should do the trick. And with tools like jarhoo, jarfind etc. it does not take long to sort out your dependency tree.

All this simplicity makes the tool much faster than the others. And good developers should know their class dependencies quite well anyway. For example, hibernate only requires c3p0 if you use its pooling facilities. So you would have the line: <dependency group="c3p0" latest="true" if="hibernate.use.connectionpool" /> and use the same flag to control your hibernate config generation. Manual conflict/dependency resolution is a small price to pay for empowerment.

Credit where it is due though. None of this would be possible without the vision of the Maven style projects that have both driven expectations and developed the invaluable repositories.

No comments: