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
- Twitter's Open Source Summit: Bootstrap 2.0 Edition
- Refreshing AppFuse's UI with Twitter Bootstrap
- 2011 - A Year in Review
- Upgrading AppFuse to Spring Security 3.1 and Spring 3.1
- What have I been working on at Taleo?
- Our Engaging Trip to Paris and Antwerp
- My HTML5 with Play Scala, CoffeeScript and Jade Presentation from Devoxx 2011
- Deploying Java and Play Framework Apps to the Cloud with James Ward
- PhoneGap for Hybrid App Development
- Play 2.0, A web framework for a new era
Posted by Ben on February 11, 2008 at 05:22 PM MST #
Posted by GB on February 11, 2008 at 06:17 PM MST #
Posted by Matt Raible on February 11, 2008 at 06:29 PM MST #
Posted by Brett Porter on February 11, 2008 at 11:55 PM MST #