
When it comes to Ant vs Maven on a forum it usually ends up as an endless discussion, with arguments getting worse and worse, a bit like Windows vs Linux, LCD vs Plasma or Frite ou Potatoes (as they ask in Swiss Mac Donalds). Basically you have to try both to get your own opinion. Still I will try to forget what i heard and just give my experience, the experience of someone who used ant for years and giving a try to Maven.
Round one: Starting a new project
To start a new project, Maven is really nice with the archetype feature:
Typing: mvn archetype:create -DgroupId=org.jboss.portlet -DartifactId=helloworld -DarchetypeArtifactId=maven-archetype-webapp
Gets you started. It creates the (in)famous pom.xml and a directory structure. It's easy to understand where to put your files, the structure basically follow the structure of your war. The generated pom is able to create the war file in exploded and imploded form and few other things. Dependencies are easy to define as long as the binaries exist in a maven repository.
With ant, i would have to define my structure and create the script to build my war. I would also have to manage the dependencies myself of use something like ivy. In fact, i would probably reuse ant scripts that i already wrote or from others.
Wednesday, October 17, 2007
Ant vs Maven - Round 1
Maven 1 : Ant 0
I'll write more rounds soon.
Subscribe to:
Post Comments (Atom)
6 comments:
Yep, Maven is a much quicker "starting gun". As long as you're good with limiting yourself to its "conventions", it's a great tool.
Kind of similar to Ruby on Rail in that respect... they don't do the same job, but they both do lots of work for you _if_ you follow _their_ rules.
And, there's lots of best practices that went into both sets of rules.
"In fact, i would probably reuse ant scripts that i already wrote or from others."
Most IDEs will create a directory structure for you and you should always have code smippets or templates at your diisposal anyway.
Tools will be available to generate ant or mvn xml files so this is really a moot issue.
In fact there's more keystrokes in in that one maven create line then there would be to get an initial ant script up usign cut and paste.
The debate on using central repositories (and/or how) should be separate from this initial round so it should really be:
Maven 0 Ant 0
If i use an IDE directory structure, i get again constrained by this structure, i want to be free, that's why i like ant.
Yes i always reuse some ant scripts i have, but not everybody has that chance.
Maven doesn't really need code snippets or templates to start with, so that's still a +1
maven is good tool when you work in a team, because your development and platform are almost similar, maven manages all dependencies. more over i found it is really productive and zero dependency on IDE related projects.
in a team, i found many developers prefer many different IDE, mvn idea:idea is really brilliant.
convention is better in some case, maven is obviously good choise. maven forces on better modulity for artifacts.
"If i use an IDE directory structure, i get again constrained by this structure, i want to be free, that's why i like ant."
But maven is doing just the same thing (dictating the structure for you). If that's a minus for an IDE, it should be a minus for maven.
Augusto, that's what i was trying to say, i doesn't like Maven rigid structure, it is a minus point.
But overall i also like the quick start of Maven, overall i added the point to Maven, despite that drawback.
Post a Comment