Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant vs maven

 
Eshwin Sukhdeve
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18023
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Eshwin Sukhdeve
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for usefull information Tim..
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic