Maven

Maven is a project management and comprehension tool. Maven provides developers a complete build lifecycle framework. Development team can automate the project’s build infrastructure in almost no time as Maven uses a standard directory layout and a default build lifecycle.
In cases of multiple development team’s environment, Maven can set-up the way to work as per standards in a very short time. As most of the project setups are simple and reusable, Maven makes life of developer easy while creating reports, checks, build and testing automation setups.

Maven History

Maven was originally designed to simplify building processes in Jakarta Turbine project. There were several projects and each project contained slightly different ANT build files. JARs were checked into CVS

Maven Objective

Maven primary goal is to provide developer


  • ·                  A comprehensive model for projects which is reusable, maintainable, and easier to comprehend.
  • ·                  Plugins or tools that interact with this declarative model.
Maven project structure and contents are declared in an xml file, pom.xml referred as Project Object Model (POM), which is the fundamental unit of the entire Maven system.

Maven – POM

POM stands for Project Object Model. It is fundamental Unit of Work in Maven. It is an XML file. It always resides in the base directory of the project as pom.xml.

The POM contains information about the project and various configuration detail used by Maven to build the project.

POM also contains the goals and plugins. While executing a task or goal, Maven looks for the POM in the current directory. It reads the POM, gets the needed configuration information, then executes the goal. Some of the configuration that canbe specified in the POM are following.

  • ·             Project dependencies
  • ·                  Plugins
  • ·                  Goals
  • ·                  Build profiles
  • ·                  Project version
  • ·                  Developers
  • ·                  Mailing list

Before creating a POM, we should first decide the project group (groupId), its name (artifactId) and its version as these attributes help in uniquely identifying the project in repository.

Example:


1:  <project xmlns=http://maven.apache.org/POM/4.0.0  
2:  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance  
3:  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  
4:  http://maven.apache.org/xsd/maven-4.0.0.xsd">  
5:  <modelVersion>4.0.0</modelVersion>  
6:  <groupId>com.companyname.project-group</groupId>  
7:  <artifactId>project</artifactId>  
8:  <version>1.0</version>  
9:  </project>  

Comments

Popular posts from this blog

OrientDB Quick Guide

Cron Expressions

Double Submit Cookies Pattern