Jpkg and Antidote
I’ve finally gotten my act together and released Jpkg, the project I have been working on for the last few months at work. It is a Java library and Ant task for creating operating system packages, currently only Debian packages. The Ant task and library are heavily unit tested and provide as strict an implementation of the Debian specification as possible. Not all features of the .deb format are supported, but enough are implemented for the packages to be useful outside of the context of the Debian distribution itself. In the future, I’d like to add a command line interface to the library as an alternative to the Ant task.
Jpkg is actively being used to package production Java software and ship it via APT to FreeBSD servers. A build server compiles the code, copies the code into a destroot, invokes Jpkg to package the code, and then rsync mirrors the generated APT repositories throughout the infrastructure. By leveraging an existing packaging system we were able to easily support isolated distributions, dependencies, versioning, and rollbacks, none of which the previous Ruby/rsync deplyment mechanism provided. Nick Barkas did all the heavy lifting of porting dpkg/APT to FreeBSD.
In the process of writing Jpkg, I ended up writing a library called Antidote, which is included with Jpkg. This library contains useful features inspired by implementing a number of Ant tasks over the last two years, mainly to deal with mutable state and Ant reference handling. I also wanted a way to collect data validation violations and then present all of those issues to the user at once, much like a compiler, along with clear suggestions and/or reasons why the user supplied data was invalid. I’d be curious to hear from anyone who uses this library if they feel it has improved the process of writing Ant tasks at all.
I’d like to thank Landon Fuller and Robin Barooah for all the advice during development, and Three Rings Design for supporting me in open sourcing the results. Drop me a line if you find Jpkg useful.
posted on: April 20, 2008