Sie sind auf Seite 1von 9

Apache Maven

What is it ?

How does it work ?


Why use it ? Structure

Usage
Examples

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Apache Maven What is it ?

A build automation tool

Mainly for Java projects


Uses conventions for build structure / procedure Licensed by Apache

Developed via Jakarta project


Stores libraries and plugins in a central repository

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Apache Maven How does it work ?

Build controlled via pom.xml project file

POM = Project Object Model


Uses standard build order, directories, plugins Identifies dependencies in the pom.xml

One POM can call child POM's


It makes the build easier Provides uniformity

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Apache Maven Why use it ?

Remove complexity from the build process

Use a uniform process


Make the build repeatable Make the build consistent with other projects

Provides a controlled release process


Manages depedencies

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Apache Maven Structure


Using Maven 0.9 as an example

the structure of the Maven directories

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Apache Maven Usage


In terms of usage most estimates seem to agree

Maven / Ant / Eclipse are the most used

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Apache Maven Example


Taking the build of hadoop-2.0.6-alpha as an example

A parent pom.xml calls module hadoop-project

<modules> <module>hadoop-project</module> <module>hadoop-project-dist</module> <module>hadoop-assemblies</module>

Identifies plugins

<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-clover2-plugin</artifactId> <version>3.0.5</version> </plugin>

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Apache Maven Example


Taking the build of hadoop-2.0.6-alpha as an example

A child pom.xml defines properties

<properties> <failIfNoTests>false</failIfNoTests> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>

Identifies dependencies

<dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-util</artifactId> <version>6.1.26</version> </dependency>

Defines profiles Defines plugins Defines the Build

www.semtech-solutions.co.nzinfo@semtech-solutions.co.nz

Contact Us

Feel free to contact us at


www.semtech-solutions.co.nz
info@semtech-solutions.co.nz

We offer IT project consultancy


We are happy to hear about your problems You can just pay for those hours that you need

To solve your problems

Das könnte Ihnen auch gefallen