Frank W. Zammetti wrote:
 I'm not at all trying to start a flame war here, but I'd like to ask, can
anyone enumerate some real, legitimate reasons, as far as you are
concerned at least!, why Maven is better than Ant (or vice-versa if you
feel that way).

I think "Maven is better than Ant" type statements are akin to saying Java is better than C++. It's not necessarily a statement you can make across the board. It's just dependent on what you are trying to do and how.

So to answer your question, I'll avoid that type of statement and simply explain how it's been helpful to me.

1. In my day job we manage a lot of projects that depend on a lot of 3rd party jars. To add a dependency (like commons-digester) we have to do the following:

*  add the dependency to build.propertiesm as follows:
        digester.jar=commons.digester-1.6.jar
*  add the dependency to the classpath(s) in build.xml
* add the dependency to the "fetchDependencies" target in build.xml to make sure it gets downloaded.

With maven I simply add a <dependency> tag in project.xml and I'm done.

2. I was working on a project a couple years back where a lot of people wanted to download and get going. When I was using ant I had to write a document that explained where all the dependencies were and how to download them, etc. When I switched to maven, my doc changed to something like this:

"Install maven according to the installation instructions, switch to the directory where the code exists and type 'maven'."

It downloaded all dependencies and built the whole project from scratch, creating deployable artifacts (including web-based documentation). All I had to do to set it all up was edit a simple project.xml. I could've done it all with ant, but it would've taken me a much longer time to set up.

3. If you do this a lot, creating new projects is a breeze. Sure, it could be a breeze with ant if I set everything up, but Maven already has it set up for me. I just type maven genapp and I'm done.

4. Common things like jar, war, ear, junit, etc. are more easily defined (IMO) in Maven than in Ant. IOW, it requires less handcoding of the build script.

5.  Multi-project integration is very simple with Maven in my experience.

6. I like the way maven allows me to customize the properties better than ant. It seems less intrusive to the project artifacts.

None of these things are impossible to do with Ant and none of them are terribly difficult. But in Maven they are basically already done for me. As long as I can live with the way maven wants to organize my project I have to do very little to make things work -- I don't mean I have to write a lot of easy Ant XML code; I mean I don't have to do very much *at all.* And I've found that I can usually live with the way Maven organizes the project. But all that's based on my experience and I'm sure others have different experience.

Greg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to