Solved

J2ee-  Difference between Ant and Maven

Posted on 2014-03-10
1
609 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
1 Comment
 
LVL 35

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
github account with ecipse 1 47
fibonacci ten numbers 4 38
type mismatch (Object[] to double[] 4 23
JAVA API design with micro service cloud in mind 1 13
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

786 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