Agile Zone is brought to you in partnership with:

Alex Staveley is a software professional passionate about software engineering and technical architecture. He blogs about architectural approaches, Java topics, web solutions and various technical bits and pieces. Alex is a DZone MVB and is not an employee of DZone and has posted 48 posts at DZone. You can read more from them at their website. View Full User Profile

Ant vs. Maven: An Entertaining Look at the Arguments

12.08.2011
| 20644 views |
  • submit to reddit
There are many ways to organise build systems for Java projects. The two most predominant are probably still Ant and Maven.  Debates between the two tend to go around in circles with the balance now swinging towards maven - since IDE support has got better (particularly Eclipse).  My own view is if you do not have a good architecture which is modular in nature and which separates concerns that should be separated you'll run into trouble no matter what you use.  The emphasis should always be on good architecture first and foremost.   

That said, I made this short video which illustrates some of the arguments you hear from Maven-ites and Ant-ists.  It is a debate between Maeve and Anthony.  Maeve is arguing for Maven; Anthony is arguing for Ant. Obviously, it's impossible to cover every single argument but the video includes some of the principle ones. Get some popcorn and enjoy.



Source: http://dublintech.blogspot.com/2011/12/ant-versus-maven.html

Published at DZone with permission of Alex Staveley, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Yaozong Zhu replied on Thu, 2011/12/08 - 10:05am

The video is very funny. "control freak":)

Once people master some technologies, and those technogoigies serve well. Most people are not willing to try something new. That's the phenomenon happening in IT world everyday. It may take a long time for a better software getting popular, or even never getting there.

 Personally, I prefer Maven to Ant.

Sandeep Bhandari replied on Thu, 2011/12/08 - 10:27am

I would say be open to both. Some projects have ANT scripts so I have to maintan them and others have used Maven and hence I need to Maven. But since even older version Eclipse had support for ANT. I end up using ANT so that other colleagues who are not familiar with Maven can make builds without wasting too much of time in learning Maven. Also, now a days ANT scripts are run with Hudson which makes it easier to generate builds automatically.Build Path with Eclipse

Zdenek Obst replied on Thu, 2011/12/08 - 1:42pm

Nice ending (with byebye) :-) Anyway, I'm familiar with both of build systems but I see Maven as a better choice for most of projects while I would use ANT only if I need to go low-level (and I'm lazy to write custom plugin). As Y.Z. stated the phenomenom of new things getting popular - which is true. I think that people who are familiar with ANT (I mean custom written ANT not generated by some IDE) can easily, in short time period, switch to Maven.

Fabrizio Giudici replied on Thu, 2011/12/08 - 2:55pm

"since IDE support has got better (particularly Eclipse)"

That is, Eclipse, that offered the worse support to Maven, has been considerably improved. True. But NetBeans and IDEA have got excellent Maven support since a long time, so a good push to Maven has been provided by all the major IDEs.

Dan Howard replied on Thu, 2011/12/08 - 6:55pm

Actually this sounds more like "Yet 100 more reasons to not use Hibernate"

Steven Baker replied on Thu, 2011/12/08 - 7:52pm in response to: Zdenek Obst

@Zdenek,
What kind of plugin would you write? I have very rarely come across a requirement that an existing plugin doesnt handle already.

Fast Zhong replied on Fri, 2011/12/09 - 12:01am

I dislike maven and hibernate. Yes, i do use them in some projects, but always stay from them if possible. I did not see any particular things or problems that can be solved only by maven/hibernate and solved in a nice way.

Erwin Mueller replied on Fri, 2011/12/09 - 2:49am

I love Maven. You just tell Maven what to do and not how to do it. I wish more applications are like that. Also I like the central maven repository and the convention vs. configuration.

 The central maven repository is like the repositories in Linux. It's making my life so much easier, no more pulling libraries together and configure everything manually. I missed Maven so much as I did Asp.net.

Also the packaging and deploying is so easy with maven. I like how I can compile, test, package in an installer and deploy the project all in one command and that only with the addition of a few lines of plugins.

Joseph Hirn replied on Tue, 2011/12/13 - 8:30pm

I'm not going to itemize, but Anthony is wrong about several of his assumptions.

Maeve did a poor job calling him on his BS, which is what most anti-Maven views are to begin with. 

John David replied on Wed, 2012/01/25 - 7:03pm

  • Ant doesn't have formal conventions like a common project directory structure, you have to tell Ant exactly where to find the source and where to put the output. Informal conventions have emerged over time, but they haven't been codified into the product.
  • Ant is procedural, you have to tell Ant exactly what to do and when to do it. You had to tell it to compile, then copy, then compress.
  • Ant doesn't have a lifecycle, you had to define goals and goal dependencies. You had to attach a sequence of tasks to each goal manually.

Where Maven...

  • Maven has conventions, it already knew where your source code was because you followed the convention. It put the bytecode in target/classes, and it produced a JAR file in target.
  • Maven is declarative. All you had to do was create a pom.xml file and put your source in the default directory. Maven took care of the rest.
  • Maven has a lifecycle, which you invoked when you executed mvn install. This command told Maven to execute the a series of sequence steps until it reached the lifecycle. As a side-effect of this journey through the lifecycle, Maven executed a number of default plugin goals which did things like compile and create a JAR.

new java

Kookee Gacho replied on Fri, 2012/06/15 - 12:09pm

Maven is built using a plugin-based architecture that allows it to make use of any application controllable through standard input. Theoretically, this would allow anyone to write plugins to interface with build tools (compilers, unit test tools, etc.) for any other language. In reality, support and use for languages other than Java has been minimal.-Madison Pharmacy Associates

Kookee Gacho replied on Fri, 2012/06/15 - 12:15pm

Maven is built using a plugin-based architecture that allows it to make use of any application controllable through standard input. Theoretically, this would allow anyone to write plugins to interface with build tools (compilers, unit test tools, etc.) for any other language. In reality, support and use for languages other than Java has been minimal.-Madison Pharmacy Associates

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.