I was going to post a comment on Dion’s blog about his
entry on Maven
when I realized that Mike posted it for me…
In short, ant‘s <import> and <macrodef> are absolute life savers. They
have brought a lot of sanity into my build files, which I thought were already
pretty lean and mean:
- All my build files have shrunk a lot thanks to <macrodef> ("extract
method"). - All the targets contain fewer commands, and they clearly state their
intent thanks to well-chosen names ("keep methods short"). - The macros contain a set of sensible defaults that make most of their
invocation straightforward and with rarely more than a couple of parameters
("program for the default case").
These rules of thumbs coupled with the following simple guidelines:
- Everything that may vary from an installation to another should go into
a build.properties, all the rest goes into your build file. - Break down your build files logically (e.g. I like to have all the
macros defined in build-macros.xml and <import> it everywhere I need it).
… give me a feeling of empowerment and control over my infrastructure.
Another important point is that I only need to know two languages to find my
way in ant (Java and ant‘s XML) while Maven requires me to
learn four different languages: Java, ant‘s XML, Maven’s XML
and… gulp… Jelly.
I still like the idea behind Maven but even today, when I see that the same
criticisms we were hearing two years ago still crop up on a regular basis, it
doesn’t make me very confident on my ability to diagnose Maven meltdowns.
#1 by Daniel Serodio on February 11, 2005 - 7:43 am
Would you mind sharing your build scripts? I suppose you must have “template” scripts for new projects…
#2 by George Coller on February 11, 2005 - 8:33 am
Yes, I looked into Maven recently and wondered if the overhead of learning it (and teaching it to the employees where I consult) would be worth it. When I saw Jelly as the scripting language I dropped the idea completely. Scripting in xml just doesn’t seem like the best idea.
I haven’t played with ant macros yet but the import saved my butt on my last project which had many modules.
If you are allowed to share some of your macro templates please do so.
#3 by Jason Carreira on February 11, 2005 - 10:55 am
Check out Savant. It gives you dependency management even better than Maven’s (it finds the transitive closure of dependencies if you’ve specified the dependencies of your dependencies, etc), plus it lets you keep your Ant build with just a few additions.
#4 by Bruce Snyder on February 11, 2005 - 8:07 pm
Check out the build setup that Howard has created for Hivemind called Hivebuild. He uses macrodefs fairly extensively.
#5 by notgartner.com: Mitch Denny's Blog on February 12, 2005 - 3:35 am
MFC, .NET and Java! UI’s and multi-threading.
#6 by Geoffrey on February 12, 2005 - 9:06 am
On the Maven userlist, Jason said that maven 2 will drop Jelly in favor of plain old java and other, better xml scripting languages.
#7 by Anonymous on February 12, 2005 - 9:42 am
I doubt Maven 2 will ever see the light. Too much energy has been spent in more than 2 years to create chaos.
If they create a version 2 it will be incompatible with version 1 (even with micro releases it was already hard to have somewhat backward compatibility) and it will make existing Maven builds and the loadcrap of plugins complete history which is not what people want to heard.
But Maven people like to mess around the build all the time, so sure again they will convert existing build 1 version to version 2 alpha pre release to create more havoc. 🙂
#8 by Todd Huss on February 13, 2005 - 7:21 pm
I really like the concept of Maven. While the execution does fall short in some areas with Maven 1 I do hope it provides impetus for other projects to create a higher level build system on top of Ant that provides a default means of dependency management, multi-project relationships, and generation of build artifacts such as jars, wars, and ears.
Perhaps it’s Maven 2 or perhaps someone creates a suite of Ant macros. Either way there’s a real need for higher level build systems to enable people to jumpstart their projects.
I don’t want to have to maintain “my” set of macros to build build source, run unit test, and generate a WAR when every other company out there is doing it in almost the same way. I want to see reuse on the inter-company level and that I believe is the aim of a high level build system such as Maven.
#9 by Henri Yandell on February 17, 2005 - 6:47 pm
With Ant you have to have people who can code in Ant, and are happy with XML.
With Maven you just need people who are happy with XML.
Yes you can extend Maven with Jelly, and you can extend Ant with Java, but for most projects you shouldn’t need to.
#10 by Jonathan Aquino on February 25, 2005 - 1:28 pm
Cedric – Thanks for the pointer to the macrodef and import tags. I have used this knowledge to create the first video game written in Ant. It has a nice skiing theme. http://jonaquino.blogspot.com/2005/02/first-video-game-written-in-ant.html