Brett Porter has a terse branch in Maven that introduces an incrementally leaner syntax for Maven POMs. If you’ve used Maven, you’ve probably cursed it repeatedly for relying too heavily on an element only approach to XML configuration. To illustrate the problem, consider a Maven 2 POM declaring a simple dependency:
<dependencies> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <version>1.1</version> </dependency> </dependencies>
Brett’s terse branch is an incremental improvement. He’s changed many of the properties in a Maven POM to XML attributes. In Brett’s terse branch, the dependency declaration shown above turns into this:
<dependencies> <dependency groupId="javax.activation" artifactId="activation" version="1.1"/> </dependency>
This is a small change, but a welcome one. Anything that can save keystrokes makes sense as my POM files have grown unwieldy over the past few months. I’m also sick of wasting book pages listing POM after POM. If you’ve ever tried to write a book about Maven, you’ll realize just how insane it is that a tool that professes to follow the “Convention of Configuration” design pattern requires so much configuration to achieve simple results. (From my Editor: “If Maven is so easy, why does it require all of this XML.”) Maybe Brett’s incremental changes are a step in the right direction? Hopefully, we’ll see more innovation in the weeks to come.
While the Maven team has made it abundantly clear that they are not interested in revolutionary changes to the Maven POM, now’s your chance to comment on the proposed format changes. If you have any ideas about how to make POMs less verbose and more readable, leave a comment on this thread.