The debate with Ant vs Maven is more like the debate between C and
Java
Ant is
proceduralmore flexibleeasier to mess up
Maven is
object orientedless flexiblemakes 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.