maven 2 introduction

12
© Logica 2008. All rights reserved Apache Maven 2 Valentin Jacquemin Mohammed AIT OUFKIR

Upload: valentin-jacquemin

Post on 12-May-2015

3.988 views

Category:

Technology


3 download

DESCRIPTION

Quick introduction about maven a Java project management tool.

TRANSCRIPT

Page 1: Maven 2 Introduction

© Logica 2008. All rights reserved

Apache Maven 2Valentin Jacquemin

Mohammed AIT OUFKIR

Page 2: Maven 2 Introduction

12 April 2023 Title of Presentation

Agenda

• Definition and origines

• Ant VS Maven

• The POM file

• Maven plugins

• Maven archetypes

• Repositories

• Dependency Management

• Lifecycle

• A quick demo

• Q&A

No. 2

Page 3: Maven 2 Introduction

12 April 2023 Title of Presentation No. 3

Definition and origines

• What is Maven– The Maven aim

– The current version

• How it comes to us?– Brief History

– The creator of Maven (Turbine)

Compilation

Maven

Validation

Dependency

Documentation

Site

Deployment

Page 4: Maven 2 Introduction

12 April 2023 Title of Presentation No. 4

Ant VS Maven : the advantages of Maven

• Versioning managed by Maven

• Maven provides conventions

• Extensibility, reusability

• Better quality in deliveries

•Less time spent

VS

Valentin Jacquemin
Page 5: Maven 2 Introduction

12 April 2023 Title of Presentation No. 5

The POM

• What is Maven POM?

• Anatomy of a basic POM

<project>

<modelVersion>1.0.0</modelVersion>

<groupId>com.mycompany.app </groupId>

<artifactId>my-app</artifactId>

<packaging> jar </packaging>

<version>1.0-SNAPSHOT</version>

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>3.8.1</version>

<scope> test</scope>

</dependency>

</dependencies>

</project>

Maven

Build Processing

Pom

POM

Project

Page 6: Maven 2 Introduction

12 April 2023 Title of Presentation

Maven plugins

Plugin : collection of goals with a general common purpose.

No. 6

Some examples:

• jboss-maven-plugin

• javadoc

• surefire (unit tests)

• ejb

Valentin Jacquemin
Maven à la base est un framework qui s'exécute au travers de plugins; tout le boulot se fait grâce à eux. Certains font partie du noyau et sont livrés avec maven par défaut. D'autres peuvent être ajouté et ceux-ci peuvent avoir plusieurs fonctions:- core- packaging /tools- reporting- tools- ide
Page 7: Maven 2 Introduction

12 April 2023 Title of Presentation

Maven Archetypes

• what is Maven Archetype?

• Archetype is a plug-in

• A list of predefined archetypes

• Generating application structure from an archetype

• Generation an archetype from an existing project

No. 7

Page 8: Maven 2 Introduction

12 April 2023 Title of Presentation

Maven Repositories

No. 8

Local repository contains artifacts used so far

groupId

|-- artifactId

|--- version

|-- artifactId-version.pom

Remote repository is a global artifacts warehouse on a remote server

Page 9: Maven 2 Introduction

12 April 2023 Title of Presentation

Dependency Management

• How maven manage dependencies? – Transitive dependency.

• Dependency scope

No. 9

Library for Mapping ORM

Library for text

Library for test

<dependencies>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>3.8.1</version>

<scope> test</scope>

</dependency>

</dependencies>

Page 10: Maven 2 Introduction

12 April 2023 Title of Presentation

• 3 Buit-in Lifecycles

• Several phases for each Lifecycle

• One or many plugins for each phase

• Simple Actions or Goals.

No. 10

Phase IIPhase II

Phase IDefault

Phase IIPhase II

Phase Iclean

Phase IIPhase II

Phase ISite

Lifecycle

Page 11: Maven 2 Introduction

12 April 2023 Title of Presentation

Demo

No. 11

Page 12: Maven 2 Introduction

12 April 2023 Title of Presentation

Q&A

No. 12