maven 2 introduction
DESCRIPTION
Quick introduction about maven a Java project management tool.TRANSCRIPT
![Page 1: Maven 2 Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/1.jpg)
© Logica 2008. All rights reserved
Apache Maven 2Valentin Jacquemin
Mohammed AIT OUFKIR
![Page 2: Maven 2 Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/4.jpg)
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
![Page 5: Maven 2 Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/5.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/6.jpg)
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
![Page 7: Maven 2 Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/7.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/9.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/11.jpg)
12 April 2023 Title of Presentation
Demo
No. 11
![Page 12: Maven 2 Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062513/5551260cb4c905f1528b4822/html5/thumbnails/12.jpg)
12 April 2023 Title of Presentation
Q&A
No. 12