Wednesday, January 26, 2011

Maven: Easy Build Tool Part I

Here I am going to post series of small posts about maven.

Maven is a project of Apache foundation which ease the software building process.Now this is the famous project management software widely adapted across the software world.The understanding of the philosophy of the maven and familiarity with this software is essential requirement for programmers.If i tell what is maven in one sentence,maven consists of project object model (pom) ,set of standard template ,project life cycle ,a dependency management system and a logic for executing plugin goals during desired phase of the life cycle .The above feature are constructed as a module on the top of core software this is why each lifestyle event can be customized by plugins.
Project Object Model(pom.xml)
This is a XML file representing project setting.When we run the maven in a particular directory the maven scans the directory for this file and do the set up according this file.So it is mandatory for every maven project.Here the overview of the pom.xml file.

<project xmlns=""

  <!-- The Basics -->

  <!-- Build Settings -->

  <!-- More Project Information -->

  <!-- Environment Settings -->
Maven Coordinates
Maven Coordinates is an identifier of the maven project which uniquely represents a maven project.This is used to locate the project artifact when the maven search for the project dependency in local repository.
<project xmlns="" 
   <name>Spring IOC Example</name>

project descried by above minimal POM is located as $M2_REPO/com/ajajavaexamples/springIOCExampl
Usually the groubId represent the company for which the project belongs to and the artifactId uniquely represent the project with in the company .Version is a series number dictate the progress of the project.The package indicates the for example weather it is jar or war project.
Rest of the things will be covered in next post.