aspose file tools*
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
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
Author

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

Murugesan Pitchandi
Greenhorn

Joined: Nov 19, 2008
Posts: 8

Hi,

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,
Murugesan.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
"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 - my free Android networking tools app
Murugesan Pitchandi
Greenhorn

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: 16250
    
  21

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: When we can choose ANT? When we can choose MAVEN?