?
Solved

J2ee-  Difference between Ant and Maven

Posted on 2014-03-10
1
Medium Priority
?
656 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 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 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 how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month12 days, 9 hours left to enroll

777 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