Solved

J2ee-  Difference between Ant and Maven

Posted on 2014-03-10
1
617 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
difference of if loops 23 62
Java string replace 11 55
jsp insert to database example 2 47
junit as external jar or library 7 24
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

807 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