Monday February 11, 2008
Maven now supports attributes in pom.xml?! In December 2005, I asked Is it possible to make pom.xml simpler?.
After seeing what the Spring Developers have done to simplify Spring context files, I can't help but think the same thing is possible for Maven 2's pom.xml. Is it possible to add namespaces and make something like the following possible?
Before:
<dependency>
<groupId>springframework</groupId>
<artifactId>spring</artifactId>
<version>1.2.6</version>
</dependency>
After:
<dep:artifact name="org/springframework/spring" version="1.2.6"/>
Or just allow attributes to make things a bit cleaner?
<dependency groupId="org.springframework" artifactId="spring" version="1.2.6"/>
At that time, the general response was "That's how Maven works. It's a matter of taste. You'll get used to it." It's been two years and sure, I'm used to it, but I'd still rather write less XML. That's why I was particularly pleased to see Brett Porter's write Maven now supports condensed POMs using attributes:
The issue is being tracked under MNG-3397.
The result is that something like this:
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>easymock</groupId> <artifactId>easymock</artifactId> <version>1.2_Java1.3</version> <scope>test</scope> </dependency> ...
Halves in length to something like this:
<dependency groupId="junit" artifactId="junit" version="3.8.1" scope="test"/> <dependency groupId="easymock" artifactId="easymock" version="1.2_Java1.3" scope="test"/> ...
Now that wasn't so hard was it?
Posted in Java
at Feb 11 2008, 03:45:57 PM MST
4 Comments
Search This Site
Recent Entries
- The Colorado Software Summit and Spring 3.0's SVN
- Appcelerator with Matt Quinlan
- Xebia RIA Framework Contest
- Ajaxified Body: Now with Back Button and Bookmarking Support
- Ajaxified Body
- Oktoberfest: Best. Vacation. Ever.
- My Oktoberfest Adventure Begins
- Performance Testing Memcached
- RE: How Open Source is Spring?
- Abbie gets her first tooth and The Bus looks great!
Posted by Ben on February 11, 2008 at 04:22 PM MST #
Posted by GB on February 11, 2008 at 05:17 PM MST #
Posted by Matt Raible on February 11, 2008 at 05:29 PM MST #
Posted by Brett Porter on February 11, 2008 at 10:55 PM MST #