*
The moose likes Ant, Maven and Other Build Tools and the fly likes ant vs 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 "ant vs maven" Watch "ant vs maven" New topic
Author

ant vs maven

Eshwin Sukhdeve
Ranch Hand

Joined: Mar 15, 2012
Posts: 80
Hi,
I need to know when we should use maven and when we should use ant .I have idea about ant but dont have idea about maven.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

Maven's strengths are:

* Enforces a standardized project layout. This saves time getting new people working on the project.
* Provides automatic resolution of dependencies, which are cached so that when you have multiple projects, you don't need to keep making local copies.
* Promotes the concept of a resource repository.
* Can create complex products with minimal direction.
* The build environment is pretty portable. You can generally import a clean Maven Project and build immediately with no need to set up a customized external build environment.

Maven's weaknesses are that some people don't like the standardized layouts, and if you have an unusual type of project, you have to either create your own mojo or embed Ant tasks in the POM. Also Maven is "magic", so there's no real way to tell what maven goals can be used on a particular project. Although, conversely, more goals are generally available than there would have been if you'd had to hand-code them all.

Ant's strengths are:

* Flexibility in project organization. If you're just too superior to use someone else's project structure, you can do your own
* Arbitrarily complex builds. For things where a "canned" set of build rules don't cut it, you can define your own.
* Self-documentation. Since there's no "magic", you can tell fairly precisely what goals are available.

Ant's weaknesses are that you can't get automatic resource resolution with basic Ant (although you can use Ivy), you have to code your own rules in detail for each project, and the build environment is only as portable as the person who designed the build.xml forced it to be.

Mostly these days, I use Maven, since my projects are primarily webapps with a dozen or so dependencies. But I still keep Ant around for more specialized needs.


Customer surveys are for companies who didn't pay proper attention to begin with.
Eshwin Sukhdeve
Ranch Hand

Joined: Mar 15, 2012
Posts: 80
Thanks for usefull information Tim..
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Also, if you search this forum for "ant maven" then you will find numerous prior discussions, such as these:
http://www.coderanch.com/t/555475/tools/Build-tools-comparison
http://www.coderanch.com/t/555582/tools/Best-build-automation-tool-ANT


JBoss In Action
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ant vs maven
 
Similar Threads
Keeping tests in sync
Maven or Ant?
when maven and when ant?
Should i move my builds from ANT to Maven?
build file generator - final builder