Solved

J2ee-  Difference between Ant and Maven

Posted on 2014-03-10
1
640 Views
Last Modified: 2014-03-15
Hi All,
Can someone please list with an example difference between Ant and Maven?

Does they play any role with kind of progamming used to build java app like struts, hibernate, spring?

Thanks
0
Comment
Question by:crazywolf2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

Accepted Solution

by:
mccarl earned 500 total points
ID: 39919139
Can someone please list with an example difference between Ant and Maven?
They are basically the same, in that they help to automate the building of applications, including the compiling, testing and packaging of the application (and others).

The main difference is that Maven has built-in support for managing the resolution of dependencies, ie. you just indicate to Maven that you code depends on the Spring libraries, and it can automatically download those dependencies and include them in your application, etc.

The other difference that I will highlight is that (at least in my way of thinking) Ant is much more like a scripted build, where you define each step in the build process and Ant will execute them. Whereas Maven has that, but the build process flow is more built in to Maven and you just "hook" certain parts of it to do what you want. An example of what I'm saying is if you just wanted to zip a certain set of files (say your source files), you can easily write an Ant build file to do that, whereas with Maven it may be possible but you would need to jump through lots of hoops to get Maven to bypass all its "default" build process flow.

Does they play any role with kind of progamming used to build java app like struts, hibernate, spring?
Not really, because you still write your Java app in exactly the same way. It just changes your workflow when you are compiling/testing/packaging/deploying your app.

Note also, that both Ant and Maven can be used together! There are Ant tasks that can be used to run maven builds and handle dependencies like maven. Also, there are Maven plugins that can be used to execute ant builds. Finally, you can have a project that is built/managed by Maven and you can still manually run different Ant builds/tasks for those jobs that Ant handles better. It's totally up to the developer.
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question