Thursday 11 February 2016

Difference between pom.xml(maven) and build.xml(ant)

Difference between pom.xml(maven) and build.xml(ant):
============================================
1.Maven doesn't have formal conventions like a common project directory structure, you have to tell Ant exactly where to find the source and where to put the output. Informal conventions have emerged over time, but they haven't been codified into the product.
                    Ant has conventions, it already knew where your source code was because you followed    the convention. It put the byte code in target/classes, and it produced a JAR file in target.

2.Maven has a convention to place source code, compiled code etc. So we don't need to provide information about the project structure in pom.xml file
         Ant doesn't has formal conventions, so we need to provide information of the project structure in build.xml file.

3.Ant is a tool box.
                      Maven is a framework.
4.Ant is mainly a build tool.
                      Maven is mainly a project management tool.
5.Ant scripts are not reusable.
                      Maven plugins are reusable. 
6.Ant is procedural, you need to provide information about what to do and when to do through code. You need to provide order.
                        Maven is declarative, everything you define in the pom.xml file.

No comments:

Post a Comment