24 January 2007

I just found a tool called "archy"!

I have archetype-fever. I’m not ashamed of it. Long have I lusted over toolset x but not had the inner strength or resolve to spend the night setting up an ant build that MIGHT one day be integrated into my workflow, let alone quick enough for a 5 minute test. Maven archetypes make the agile “10 minute test” a possibility. Java’s robbed open source projects of their 10 minute tests by being so complicated to bootstrap. With installation and compilation the norm, configuration is par for the course. Who has time? Who has more than 10 minutes, anyway?

A really polished project will have some sort of installation mechanism. But often times, it’s non standard, or half-assed. Download Tomcat for Windows and be received with a windows installer with all the bells and whistles. Download it for linux and…look forward to configuring a few things..

If you’ve got a project that’s a webapplication and you’ve got an installation process, then that’s impressive! Tigris.org’s Scarab, for example, has an installer. That’s not to say that there’s no configuration at all, What’s more, in Scarab’s case, I definitely would have preferred some documentation and a few bug fixes in lieu of that installer!

Archetypes give the project the spotlight and take care of the minutiae. This is why, unless it’s very exotic (J2ME and Jini spring to mind! A proposito: has any one found a useful maven 2 plugin for J2ME or GWT?), I wait for the archetype. Simply add the archetype’s repository to ~/.m2/settings.xml and run that familiar invocation, “mvn archetype:create …”. Voilà, out pops a working project. You invoke mvn idea:idea at the root and off you go building a new application!

So fine, maven archetypes are amazing. Though, now you’re where you started, in a sense, aren’t you? Not quite as bad, but bad. You have to know where the archetypes are for them to be of any use to you! You could easily spend the time just looking for a way to avoid getting invested too much into some technology without a result.

That’s where archy comes in. It has a centralized listing of archetypes and their corresponding repositories and a command line interface to guide you through using any of them. It reads from this Wiki page, and it reads from archetypes.xml, on the local classpath. There doesn’t seem to be an easy to use way to expand that, though. I suppose you could just author your own archetypes.xml and put that on the root of classpath and it would resolve that, instead. I haven’t perused the source itself, so I don’t know. I’ll certainly get into it as I add more archetypes to my arsenal. Here are a few of note: Matt Raible's Appfuse, and a JBoss Seam archetype.

Update: I just found Pyx4me.com, which, among MANY other golden nuggets, seems to have a working Maven 2/J2ME plugin. Goodbye kludgy old Maven 1 / Antenna wrapper! I hope!