×
Namespaces

Variants
Actions

Maven Build Tool

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: senthilkumar05 (28 Dec 2007)
Last edited: hamishwillee (31 Jul 2012)


Maven Build Tool


Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.


Maven's Objectives
Maven's primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with:
• Making the build process easy
• Providing a uniform build system
• Providing quality project information
• Providing guidelines for best practices development
• Allowing transparent migration to new features

The project object model
The heart of a Maven 2 project is the project object model (or POM for short). It contains a detailed description of your project, including information about versioning and configuration management, dependencies, application and testing resources, team members and structure, and much more.
The POM takes the form of an XML file (pom.xml), which is placed in your project home directory.
Pom.xml contains
• The project-related properties
• The build process-related properties
• The environment-related properties


A simple pom.xml file is shown here:


<project xmlns="<nowiki>http://maven.apache.org/POM/4.0.0"</nowiki>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.javaworld.hotels</groupId>
<artifactId>HotelDatabase</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maven Quick Start Archetype</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>


Repositories
Maven introduces the concept of repositories. A repository can be seen as an artifact version control system. Ultimately, all projects products are going to end up in a repository.
In fact, Maven uses repositories to store about anything : plugins, dependencies, extensions, ... Whenever it needs a artifact, Maven will look into its different repositories to find it.
There are two different types of repositories: local and remote.
There is always one local repository for a given Maven installation accessible from the file system.
Remote repositories allow you to makes your project artifacts available to other developers. A remote repository can be accessed through a network protocol.

This page was last modified on 31 July 2012, at 10:21.
30 page views in the last 30 days.