Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant versus Maven

 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been reading the Ant manual and some "getting started" web sites, and one issue keeps coming up. There are many who are of the opinion that Ant is an antiquated tool (including it's author) and my time is better spent learning Maven 2.

Thoughts?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "Similar Topics" area below on this page has certain threads which already contain a discussion about this topic. You might want to take a look at them - one of them has a lengthy discussion.
 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I've been looking through those. The opinions are all over the map and some are quite passionate in their choices. I can see that this is almost like a Windows versus Mac religious war with no real answer to be had.

Based on the threads here and on other sites, it appears that Ant is a good starting place. It sounds like it's easier to learn and better documented. Maven sounds more powerful but more time consuming to setup and customize with some features I really don't need, such as pulling dependencies from a repository.

Unless someone can convince me otherwise, I think I'll continue with Ant and consider Maven when and if I find something that I can't accomplish with Ant. Walk first, run later.
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The debate with Ant vs Maven is more like the debate between C and Java

Ant is
  • procedural
  • more flexible
  • easier to mess up


  • Maven is
  • object oriented
  • less flexible
  • makes it harder to mess up


  • Ant is not a good tool if your project is a large multi-module project that is being worked on. Ant is good for small standalone projects. The project that I came on was 3 years old and had 40 developers working on it. There were hundreds of tasks in the build xml, and the developers would run something like "ant clean install install-web" every time they had to run the build. Not one person in the team knew what these targets did. They were just using that command ritualistically. People who had built the ant build left, and then people added stuff to it, and over 3 years it grew to a mess. I tried to figure out the build. The first thing I did is find a tool that visualized the ant build. I wanted to get an idea of the overall structure before I went into the details. The tool drew a graph with each task a a node and dependencies between tasks shown as lines. I was expecting a large tree. Right? You would expect a few high level tasks that called other smaller tasks that called other smaller tasks. The only way to describe what I got was that it looked like a bus terminal. There were all these nodes on the side, and the lines between the nodes was so muddled up, it looked like a highway. I couldn't even begin to pick the lines apart. It was all spaghetti.

    It's very easy to make a ant build into a spaghetti build. Sure, if you do some "design" you can have a nice ant build. The problem is developers don't spend time designing the build. You just want the shit to build, right? 90% of the time you want to add code, compile, load test data, run unit test, deploy to JBoss. Maven makes that 90% of the tasks very easy

    Edit: If you are learning, I would say that you should learn both, because it would improve your chances of getting a job if you know both. I would prefer Maven over Ant simply because a lot of open source projects are going towards Maven because of the depdendency management features of Maven, and if you start diving into the Open source community, you will find that it's easier if you know Maven already. Maven has a lot of new concepts to learn though. It is a tough choice.

     
    J. Kevin Robbins
    Bartender
    Posts: 1759
    19
    Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks, Jayesh. Excellent summary. That's very helpful. I'll take your advice and learn both. I'll start small with a test app and not our production app.
     
    Jayesh A Lalwani
    Rancher
    Posts: 2756
    32
    Eclipse IDE Spring Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hmm.. if there is a production app that you are going to work on very soon, then I would just learn the build tool that the app uses. Generally speaking, unless build tools are creating huge problems, most established projects don't change their build tools.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic