Thursday 13 February 2014

Differences between Ant and Maven



 

The differences between Ant and Maven in this example? 


Ant 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 is procedural, you have to tell Ant exactly what to do and when to do it. You had to tell it to compile, then copy, then compress.
  • Ant doesn't have a lifecycle, you had to define goals and goal dependencies. You had to attach a sequence of tasks to each goal manually.
  • Ant is mainly a build tool.

Where Maven...

  • Maven has conventions, it already knew where your source code was because you followed the convention. It put the bytecode in target/classes, and it produced a JAR file in target.
  • Maven is declarative. All you had to do was create a pom.xml file and put your source in the default directory. Maven took care of the rest.
  • Maven has a lifecycle, which you invoked when you executed mvn install. This command told Maven to execute a series of sequence steps until it reached the lifecycle. As a side-effect of this journey through the lifecycle, Maven executed a number of default plugin goals which did things like compile and create a JAR. 
  • Maven is a project and dependencies management tool which build project as well.
  • Maven support modules base project integratio.

Default life cycle of Maven : 


  • validate - validate the project is correct and all necessary information is available
  • compile - compile the source code of the project
  • test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
  • package - take the compiled code and package it in its distributable format, such as a JAR.
  • integration-test - process and deploy the package if necessary into an environment where integration tests can be run
  • verify - run any checks to verify the package is valid and meets quality criteria
  • install - install the package into the local repository, for use as a dependency in other projects locally
  • deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

1 comment:

  1. Gambling in Vegas: Casino Sites & Sites Reviewed by
    › casino › casino Gambling in Vegas: Casino Sites & Sites Reviewed by · Casino Site Reviewed by · Online 메리트카지노 Casino · Casino 메리트카지노 Site Reviewed by 카지노사이트 · Online Casino Reviewed by · Online Casino

    ReplyDelete