Don Brown Makes Maven 2 Not Suck
Don Brown spent some time over the weekend Making Maven 2 not suck:
While there are a few (very important, I might add) things Maven 2 gets right, there are a bunch that just suck, yet I use it at my day job (Atlassian) and in Open Source work, so in true Open Source tradition, rather than continue bitching, I'm doing something about it. I'm embarking on a quest to fix all the bits of Maven 2 that really annoy me and waste my time. I hope to get most, if not all, of the changes back into the codebase, but my personal deliverable is a build of Maven 2 that doesn't suck.
On his blog, Don lists a number of improvements he hopes to make. This weekend, he implemented the first three, which concentrates on speeding up remote repository access and downloading of artifacts.
First up, tasks #1-3. I implemented these changes in a bored Sunday afternoon and saw a example build (Struts 2 core) go from 3 minutes, 26 seconds to 2 minutes even, so a little over 40% performance improvement.
Interested, I decided to try Don's improvements on AppFuse. Since it fetches seemingly hundreds of artifacts from Maven's central repository, it seemed like a good testing ground. With a clean repository (rm -r ~/.m2/repository), a 8 MB/sec internet connection and "mvn -Dmaven.test.skip", I achieved the following results with the stock version of Maven 2.0.8:
[INFO] Total time: 7 minutes 40 seconds [INFO] Finished at: Mon Jan 28 09:02:11 MST 2008 [INFO] Final Memory: 55M/508M
With Don's improved uber-jar, I received the following results:
[INFO] Total time: 5 minutes 17 seconds [INFO] Finished at: Mon Jan 28 09:10:56 MST 2008 [INFO] Final Memory: 56M/508M
460 vs. 317 seconds = a 31.1% improvement -- Nice work Don!
When he implements #4 (Should support artifacts checked into the SCM in the lib/ directory so no external repository needed), I'll be a much happier Maven consumer. I've always wanted the ability to bundle all of AppFuse's dependencies for offline use like we did in 1.9.x.
Don - I'll buy you numerous beverages in Vegas if you add the ability to run a Maven command to put all a project's dependencies in its lib directory too. ;-)
Matt Raible has been building web applications for most of his adult life. He started tinkering with the web before Netscape 1.0 was even released. For the last 11 years, Matt has helped companies adopt open source technologies (Spring, Hibernate, Apache, Struts, Tapestry, Grails) and use them effectively. Matt has been a speaker at many conferences worldwide, including ApacheCon, JavaZone, Colorado Software Summit, No Fluff Just Stuff, and a host of others.
Matt is a DZone MVB and is not an employee of DZone and has posted 45 posts at DZone. You can read more from them at their website.
- Login or register to post comments
- 4387 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
phil swenson replied on Wed, 2008/01/30 - 10:21am
To make Maven not suck, might I suggest adopting a scripting language (groovy?) instead of continuing with XML hell?
http://philswenson.comĀ
java bean replied on Sun, 2008/02/10 - 3:59pm
With all the critical remarks the Maven project is receiving, wouldn't it be time for some Maven project lead to step up and explain the team's position ? Or is it completely deaf to the sentiments ? How many builds have to fail, how much more headaches are needed before others start their own version of Maven and do it the right way (like Don) ? Maybe they already responded and I have missed their reply ?
cheers,
javabean.
kardelen133 replied on Sun, 2008/06/08 - 8:17am