maven 2 introduction

Post on 12-May-2015

3.978 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

Quick introduction about maven a Java project management tool.

TRANSCRIPT

© Logica 2008. All rights reserved

Apache Maven 2Valentin Jacquemin

Mohammed AIT OUFKIR

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

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

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

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

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

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

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

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>

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

12 April 2023 Title of Presentation

Demo

No. 11

12 April 2023 Title of Presentation

Q&A

No. 12

top related