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

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant vs. maven" Watch "ant vs. maven" New topic

ant vs. maven

paul wheaton

Joined: Dec 14, 1998
Posts: 20877

It's been a couple of years since I've looked into this ... I've known people that tried maven and moved back to ant. Now I'm looking at starting a new project and thinking about looking into maven again ... but ... I thought it might be good to have some discussion along these lines with folks in the know.

So ... is maven clearly superior now?

permaculture Wood Burning Stoves 2.0 - 4-DVD set
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9056
Maven seems really nice for the developer who wants to get some code/project to use. I don't know if it has improved recently for the original developer who needs to set up the directory structure.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Personally, I still prefer Ant over Maven. The main reason being, while Maven let's me get started in a couple of minutes rather than several minutes, extending the built-in Maven functionality seems to be much more difficult than with Ant.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
Last time I looked into Maven, I got the impression that it really was more aligned with the needs of an open source project than with the needs of in inhouse commercial one. Which is fine, but not what I wanted at that time.

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Mark Herschberg

Joined: Dec 04, 2000
Posts: 6037
We looked at Maven and found it it was more complicated to set up than Ant. It is also harder to tweak down the road.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32507

Maven is better if you want to set up your project in the exact structure that Maven tells you too. If you want to use a different structure or have to convince people to change their structure, Ant is better.

Maven makes it harder to create a big messy build file by limiting how you can extend it. So it does what it does well. Ant does everything, even if it is sometimes yuckier to do. There are lots of extensions for both. Most of the things you'd want are written for Ant and Maven.

As you can see, I lean towards Ant.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Franck Smith

Joined: Dec 21, 2005
Posts: 18
I've been used ant in several projects. Now I have to migrate 5 projects to maven. I can say that ant and mavan are different. Maven is not just a building tool, it provide an organization and a structure layer. All you do in ant can be done in Maven because you can call ant target.
Projects I'm working on have very big and complex ant builds and don't have exactly the structure of maven convention but it's still possible to migrate them.
The most advantage to migrate to Maven are : standardization of how to handle a project, dependencies are clearly defined, the concept of artifacts that can be shared to other projects, documentations and reports, remote and local repository concepts.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17044

Maven 2 is a lot cleaner than Maven 1. Your project files should be much smaller and prettier under Maven 2.

I don't much care for Maven, since it does a lot of "magic" for you and I also prefer my (non-Maven) project directory standards.

However, the bulk of the Apache Java projects are Maven-based, so obviously someone likes it!

An IDE is no substitute for an Intelligent Developer.
Michael Duffy
Ranch Hand

Joined: Oct 15, 2005
Posts: 163
Originally posted by Tim Holloway:
Maven 2 is a lot cleaner than Maven 1. Your project files should be much smaller and prettier under Maven 2.

I don't much care for Maven, since it does a lot of "magic" for you and I also prefer my (non-Maven) project directory standards.

However, the bulk of the Apache Java projects are Maven-based, so obviously someone likes it!

I think Maven is an unnecessary complication over and above Ant.

I'd prefer looking into Ivy as a way of managing dependencies on JARs.

Guy Allard
Ranch Hand

Joined: Nov 24, 2000
Posts: 776
When I first used Ant, my eyes popped open and I said "Wow".

Maven has never had that effect on me, although several colleagues do beat that drum.

Brian R. Wainwright
Ranch Hand

Joined: Aug 12, 2003
Posts: 92
I'm currently evaluating whether to recommend that my software development group adopt Maven. My last exposure to Maven was with 1.0 at a different company. It was well received because there were no standards in place for project management and maven helped to establish and define those standards. Now that I'm with a new company with established practices however, I'm having second thoughts about Maven. While the 2.0 product does seem to be better organized, my first impression is that it may not be worth the trouble trying to migrate well established ant practices to maven. The obvious lure of Maven is the documentation and project management features which are currently lacking in my organization, yet if one can't cleanly migrate existing project structures and workflows it may not be worth the trouble. The way we're doing things now isn't necessrily broken, but it could be done better with better results. The problem I think I'm having is that Maven does so much for you that you may have to radically alter development practices in order to adopt it. In larger organizations, this is usually not an option.
Shilpa Anand

Joined: Sep 27, 2006
Posts: 1
Hi All,

I saw in some of the previous replies that some of you have migrated existing ant projects to Maven. I am trying to migrate an existing project to maven, but I am having some existing in-house library jar files which I want to use as a dependcy for compiling my project. I do not have idea about how to do it. Can anyone guide me PLEASE.....?

Thanks in advance!!!
It is sorta covered in the JavaRanch Style Guide.
subject: ant vs. maven
It's not a secret anymore!