MAVEN and ANT both are used as build tools in Java based projects. They can be used in Standalone, web or enterprise projects. There is some confusion and debate as to which one should be used. The exact answer depends upon the requirement.

I use Maven for POC (Proof Of Concept) and Demo projects and ANT build files in legacy applications (those already using ANT build files). For new projects which are through with POC stage, it is best to go for both with ANT acting as complementary to MAVEN in performing tasks which require more control.

  • The major difference between the two is that while ANT allows minute level control, maven recommends for best practices to be used.
  • There is a specific project structure recommended by Maven but with ANT, the choice of project structure is left to the developer.
  • Maven downloads the required standard jar files (like Spring, Struts, JUnit, Apache commons and JDOM) on local machine and reuses them without the developer ever needing to specifically download and add them to class path. With ANT, we need to download the required jar files, create variables pointing to the path of these jar files and then add these path variables to the classpath.
  • There is a sense of reuse with Maven, major blocks of code can be directly used from one maven build file (pom.xml) to another. However with ANT, a lot of changes are required to be made to make it suite another project.
  • There are whole lot of plugins available for Maven ranging from running unit tests, building project war/ear and generating javadoc.
  • ANT has been present for quite long time now and many projects in the maintenance phase are using ANT build scripts. The result is that lot of developers are familiar with ANT than Maven. For beginners, learning ANT is much simpler than MAVEN because of the fact that ANT uses the same terminologies used in normal applications without any build tool.

Some projects make use of both of them with ANT build file being used for performing task which require low level control. As a developer one should be aware of both of them and should be able to use any one of them when required.

Related Posts

Differences between ANT and Maven admin Core Java
MAVEN and ANT both are used as build tools in Java based projects. They can be used in Standalone, web or enterprise projects. There is some confusion and debate as to which one should be used. The exact answer depends upon the requirement. I use Maven for POC (Proof...
MAVEN and ANT both are used as build tools in Java based projects. They can be used in Standalone, web or enterprise projects. There is some confusion and debate as to which one should be used. The exact answer depends upon the requirement. I <a href="http://www.javaexperience.com/spring-maven-project-using-eclipse-plugin/" title="First Spring project configuration in Eclipse using Maven">use Maven</a> for POC (Proof Of Concept) and Demo projects and ANT build files in legacy applications (those already using ANT build files). For new projects which are through with POC stage, it is best to go for both with ANT acting as complementary to MAVEN in performing tasks which require more control. <ul> <li>The major difference between the two is that while ANT allows minute level control, maven recommends for best practices to be used. </li> <li>There is a specific project structure recommended by Maven but with ANT, the choice of project structure is left to the developer. </li> <li><a href="http://www.javaexperience.com/force-maven-to-download-dependencies-in-eclipse/" title="Force maven to download dependencies in Eclipse">Maven downloads the required standard jar files</a> (like Spring, Struts, JUnit, Apache commons and JDOM) on local machine and reuses them without the developer ever needing to specifically download and add them to class path. With ANT, we need to download the required jar files, create variables pointing to the path of these jar files and then add these path variables to the classpath.</li> <li>There is a sense of reuse with Maven, major blocks of code can be directly used from one maven build file (pom.xml) to another. However with ANT, a lot of changes are required to be made to make it suite another project. </li> <li>There are whole lot of plugins available for Maven ranging from running unit tests, building project war/ear and generating javadoc.</li> <li>ANT has been present for quite long time now and many projects in the maintenance phase are using ANT build scripts. The result is that lot of developers are familiar with ANT than Maven. For beginners, learning ANT is much simpler than MAVEN because of the fact that ANT uses the same terminologies used in normal applications without any build tool.</li> </ul> Some projects make use of both of them with ANT build file being used for performing task which require low level control. As a developer one should be aware of both of them and should be able to use any one of them when required.
Signing JAR file with certificate and verification
Why the String class is Immutable
The following two tabs change content below.
I run this blog with lots of passion. In this website, you will find tutorials on Core Java, Spring, Struts, Web Applications, Portals and Database. Please support me and the website by sharing the posts on your facebook / twitter. You can tap the share button at the top of each post. Thanks for the support.

Comments

comments