This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes When we can choose ANT? When we can choose MAVEN? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "When we can choose ANT? When we can choose MAVEN?" Watch "When we can choose ANT? When we can choose MAVEN?" New topic

When we can choose ANT? When we can choose MAVEN?

Murugesan Pitchandi

Joined: Nov 19, 2008
Posts: 8


I used MAVEN and ANT for my last few projects. Sometimes ANT and MAVEN in single projects. Now, I am wondering when we have to choose MAVEN? When we can go for ANT?

Thanks and Regards,
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 39573
"Have to"? Never, unless there are external factors or constraints to consider. Maven does dependency management, which Ant only does if you combine it with Ivy. Personally, I find that aspect of Maven irritating rather than helpful. Maven is also less flexible in its directory layout - it really wants you to use its standard, rather than whatever directory layout you might prefer.

Ping & DNS - updated with new look and Ping home screen widget
Murugesan Pitchandi

Joined: Nov 19, 2008
Posts: 8

Still I am not clear. Can you elaborate? As well it would be good if you explain with some examples.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15661

It is mostly a matter of taste, except when local shop standards mandate otherwise. Probably most of the major open-source projects are building using Maven, but some of the best-known ones use Ant, often because the designers didn't like Maven.

Ant is more flexible. It can produce multiple products according to locally-defined rules and the directory layout can be whatever you want. However you do need to augment it with Ivy if you don't want to end up with a bunch of duplicate copies of jars all over your disk drive.

Maven's virtue is its lack of flexibility. For generic projects such as WARs and JARs, there's not much point in re-creating the same basic type of project build over and over again. Maven's dependency system ensures that you can get what you need when you need it without a lot of wasted space. It is precisely because Maven enforces a strict directory discipline that I can hand a ZIP file containing project source and a POM and reasonably expect someone on the other side of the Earth to be able to unzip and build it without having to do a lot of local pre-configuration (and pre-Maven I had a lot of trouble with local configurations that clashed with each other). So a complete stranger knows how to build (typically "mvn clean package") and where the files are, and can build regardless of what OS they are running under.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: When we can choose ANT? When we can choose MAVEN?
Similar Threads
how to make a .war file
Multi module hot deployment with maven
ant vs. maven
Why Maven?
ant vs maven