« JNDI+Objects - same old | Main | QOTD »

Maven2: first impressions good

Rick Hightower once asked:

"After using Maven, how could you go back to Ant?"

Because it was unreliable, and your build tools can't be unreliable. Ant works and works in a transparent fashion. Maven is hit and miss - if your end requirements are not to produce a few jars, a website and a dist.tar.gz, or if something goes wrong and you have to debug it, that could be difficult. My preference with Java is to enforce dependency management through policy, standard project layouts and targets through an ant script that generates ant scripts (the nearest open source thingie to that seems to be Jam). Policy management of dependencies is hard work, can be risky, but in the absence of tools you have to do some amount of it.

Now here's Maven2. It's an alpha, but it's so much better than maven, they might want to think about renaming the project. It's much faster. It doesn't try to force Jelly on you. It's not wholly intuitive, but nor is actively obtuse as maven was. I work on some medium-large projects that I could see moving to Maven2.

It's an alpha, so it has problems. Most of these seem to be design problems rather bugs. When you do something wrong you typically get a an unhelpful stacktrace - that's no good, because it's not telling you whether you're doing something wrong or whether it's busted. For example, the copy of Maven2 I have blows up if its run in a directory with no project file. It blows up on genapp. It blows up on install. There's no obvious way to find the list of available targets (it doesn't follow, say, unix tool idioms). The package target is as best I can tell, broken from a usability viewpoint. The Maven2 team are honest enough in admitting that the documentation is lacking, but they need to clean up the error reporting to the end user before releasing a 1.0 (update: Dan Diephouse says the reporting is looking better in subversion). Critically, Maven2 is not just a build system it's also a networked application, but one that behaves as though the network will just be on hand to provide content. That's a fundamental design problem.

To stop supporting the project generation hack mentioned earlier, would be great. That's despite the fact there are a good few projects running on its artefacts now, personally and in Propylon. I mention it here from time to time, so people have asked about its availablity. Open sourcing it is an option, tho' it's really only a small stuntwork. Bizarre as it sounds I don't have time to organize a release, and I'm no believer in just chucking projects into open source and Brian Zimmer will be after me soon for some Jython I promised to do. The 'roadmap' for AntAnt was to integrate Jam and/or Ivy (see Ivy is everything Maven should be) and target the 1.7 Ant snapshots, maybe start describing projects using DOAP. Maven2 might mean doing none of that. The two things to figure out next are how flexible Maven2 is with regard to repository location and management (Brett Porter's subversion hack suggests this might be ok), and how easy it is to have an end result that is not a website and zip file.

Finally Maven2 really, really, really, really, really, really, really, really, really, really, really, really, really, really, really needs to drop the idea of using badly conceived XML scripting languages for extensions. Replacing Jelly with Marmalade might be witty, but it's carrying on a losing approach. Beanshell, Jython, Javascript - pick three.

May 2, 2005 10:58 PM


Dan Diephouse
(May 2, 2005 11:29 PM #)
  1. M2 is definitely fast, faster than ant :-)
  2. M2 is a preview. The error messages are much improved in the current svn, so look for that in the next alpha (in mid may I think).
  3. All the maven plugins are written in java as pojos right now. Pretty sure at least beanshell is being added in the next release and maybe jython.
  4. I have to disagree with you about marmalade. The beauty of the xml scripting language is that it integrates nicely with the ant builds/tasks that are already in existant. But for writing new plugins, I would definitely use just plain java or a real scripting language.
Anyway, I've had mixed experiences so far with it as far as usability goes. My biggest issue is dealing with jars that can't be redistributed (DO YOU HEAR ME SUN?!?!). But I'm enjoying the speed, but am anxious for the plugins to reach the feature status of m1.