At the Sydney Geek Night this week, I spent spent some time with Mike Cannon-Brookes putting a Maven build on my template application. Ok, I just sat back and watched while Mike did his thing, but in any case, I learned a bit about Maven.
The biggest eye-opener for me was the slashing and burning Mike did on the default script. The conversation kind of went like this:
Mike: "Ok, so lets grab this sample script off the documentation as a starting point. This section here is pointless, so we'll get rid of that. You don't need this bit here either. We'll throw away this crap as well..."
Me: "Whats the deal with all these reports here?"
Mike: "Oh yeah - most of those are irrelevant, so we'll get rid of these ones"
Within a few minutes, we had a working build up. It took a while to run the first few goals, because it downloaded a bunch of jars get started. Once it was done though, it did almost the same thing as my Ant build but with much less time spent on development.
Some instinctive reactions to my first Maven build:
- My Maven build file is about 30 lines long versus about 130 lines for my Ant build file. Nice...
- When I look at my Maven build file, I can't tell what things I can run on my build. Not so nice...
- My Ant build uses a patched jcoverage.jar file. So far it seems like it might take more moving parts to get Maven to do that.
- My Ant build takes about 7 seconds. My Maven build takes about 15 seconds (but that includes site generation).
I like the setup enough to keep looking into it, but I'm no convert yet...
Comments
"maven -g" will tell you what things you can run on your build.
Posted by: Magnus Heino | February 17, 2004 11:20 PM
Bloody hell - thats a lot of stuff! I guess I've still got some learning to do...
Posted by: Marty Andrews | February 18, 2004 08:22 AM
Marty,
I'd be happy to share my Maven experiences with you when we get to Byron.
Cheers,
Mike
Posted by: Mike Melia | February 19, 2004 11:03 PM
Maven appears to promise a lot in terms of its integration with java tools such as checkstyle, jcoverage, etc., however there appears little or no documentation on the web (of how to set it up easily). Were you able to find any useful resources?
Posted by: Mark Jones | March 4, 2004 08:55 PM
I am slowly becoming a Maven convert. I have tried a Maven project generator called MEGG. Here is what came of the effort:
Generate a small application and test that demonstrates
-- Use of MEGG to generate all parts of a DB Test from SQL DDL describing a simple, three table, many to many relationship.
-- Use of preGoals and Ant tasks with Maven
-- Use of the DBUnit "assertDBAsExpected?".
-- Use of the Middlegen Hibernate plugin to generate Hibernate mappings from a database.
-- Use of Hibernate to insert DB rows.
-- Use of Hibernate hbm2java.CodeGenerator? to write the persistent Java code.
-- Use of three databases (HSQL, MySQL, and Oracle) to run the test.
Download MEGG (http://sourceforge.net/project/showfiles.php?group_id=88732)
Run (if behind a firewall, substituting your proxy server name and port):
java -Dhttp.proxyHost=proxyserver -Dhttp.proxyPort=3128 -jar megg-0.1.3.jar http://cdromtool.sourceforge.net/m2mTest.zip
It creates a Maven project in a subdirectory. Accept the defaults, read the readme in the new project directory and follow the directions.
Posted by: Dennis Carroll | August 7, 2004 01:30 AM