SlideShare a Scribd company logo
POM
Repositories
Build	Life	Cycle
Maven	vs	ANT	vs	Gradle
Common	tasks
mvn	clean
mvn	package
mvn	clean	package
mvn	clean	install
mvn	plugin:goal
Standard	Project	Structure
What	is	Maven?
Installation
Define	Plugin,	Phases,	Goals
References
Apache	Maven
Define	Plugin,	Phases,	Goals
http://stackoverflow.com/questions/16205778/what-are-maven-goals-and-phases-
and-what-is-their-difference	
Phases	executes	sequentially.	Executing	a
phase	means	executes	all	previous
dependent	phases,	life	cycles
The	clean	life	cycle	has	3	phases	(pre-clean,	clean,	post-clean).	mvn	clean	It	will	call
pre-clean	and	clean.
Common	tasks
https://eckobar.files.wordpress.com/2007/02/maven-cheatsheet.pdf	
mvn	clean
cleans	up	anything	that	was	created	by	previous	builds
mvn	package
#This	packages	your	project	and	creates	.jar	file	under	target/	#To	Run	the	jar	file
created	under	target/	java	-jar	target/dateutils.jar
mvn	clean	package
cleans	up	anything	that	was	created	by	previous	builds	and	Takes	the	compiled
code	and	package	it	in	its	distributable	format,	such	as	a	JAR,	WAR,	or	EAR
file.
mvn	clean	install
cleans	up	anything	that	was	created	by	previous	builds	and	installs	the	package
in	local	/	remote	maven	repository.
mvn	archetype:generate
mvn	archetype:generate	-DgroupId=com.mkyong.core.utils	-DartifactId
	-DarchetypeArtifactId=maven-archetype-quickstart	-DinteractiveMode
Build	Life	Cycle
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html	
clean
cleans	up	anything	that	was	created	by	previous	builds
default/build
https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html	
phases
phase	is	called	via	Maven	command,	for	example	mvn	compile,	only
phases	upto	and	including	that	phase	will	execute.
validate
Validates	whether	project	is	correct	and	all	necessary	information	is	available
to	complete	the	build	process.
compile
Source	code	compilation	is	done	in	this	phase.
test
Run	tests	using	a	suitable	unit	testing	framework
package
This	phase	creates	the	JAR	/	WAR	package	as	mentioned	in	packaging	in
POM.xml.
Take	the	compiled	code	and	package	it	in	its	distributable	format,	such	as	a
JAR,	WAR,	or	EAR	file.
verify
Run	any	check-ups	to	verify	the	package	is	valid	and	meets	quality	criterias.
install
This	phase	installs	the	package	in	local	/	remote	maven	repository.
deploy
Copies	the	final	package	to	the	remote	repository	for	sharing	with	other
developers	and	projects.
site
site
https://maven.apache.org/plugins/maven-site-plugin/	
Maven	Site	plugin	is	generally	used	to	create	fresh	documentation	to
create	reports,	deploy	site	etc
site
"mvn	site”	to	generate	a	documentation	site	for	your	project	information
mvn	site:site	will	also	generate	documentation
*The	generated	site	is	under	your	project	“target/site”	folder.
site-deploy
Deploys	the	generated	site	to	the	site	URL	specified	in	the
<distributionManagement>	section	of	the	POM.	<project>	...
<distributionManagement>	<site>	<id>website</id>
<url>scp://www.mycompany.com/www/docs/project/</url>	</site>
</distributionManagement>	...	</project>
Standard	Project	Structure
https://maven.apache.org/guides/introduction/introduction-to-the-standard-
directory-layout.html	
POM
https://maven.apache.org/pom.html	
Elements*
Elements*
#Sample	pom.xml	with	mandatory	elements.
<project	xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">	
<modelVersion>4.0.0</modelVersion>	
<groupId>com.javatpoint.application1</groupId>	
<artifactId>my-app</artifactId>	
<version>1</version>	
</project>
project
<project	xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
modelVersion
<modelVersion>4.0.0</modelVersion>
groupId
<groupId>com.javatpoint.application1</groupId>
artifactId
<artifactId>my-app</artifactId>
version
<version>1</version>
Scope
Dependency	scope	is	used	to	limit	the	transitivity	of	a	dependency,
Super	POM
https://maven.apache.org/guides/introduction/introduction-to-the-pom.html	
Installation
JDK	is	pre-requisite	verify	with	java	-version
Windows
https://www.mkyong.com/maven/how-to-install-maven-in-windows/	
Linux
http://www.baeldung.com/install-maven-on-windows-linux-mac	
OSX
https://www.mkyong.com/maven/install-maven-on-mac-osx/

More Related Content

What's hot

JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
Bert Jan Schrijver
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenAlan Parkinson
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT Academy
Volodymyr Ostapiv
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in MavenGeert Pante
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
Ankur Goyal
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Slawa Giterman
 
Release With Maven
Release With MavenRelease With Maven
Release With Maveneugenn
 
Maven ppt
Maven pptMaven ppt
Maven ppt
natashasweety7
 
Pipeline based deployments on Jenkins
Pipeline based deployments  on JenkinsPipeline based deployments  on Jenkins
Pipeline based deployments on Jenkins
Knoldus Inc.
 
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home builtJenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home builtMark Waite
 
Log management (elk) for spring boot application
Log management (elk) for spring boot applicationLog management (elk) for spring boot application
Log management (elk) for spring boot application
Vadym Lotar
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Edureka!
 
CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins Pipeline
Veaceslav Gaidarji
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
Onkar Deshpande
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01
rhemsolutions
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
ericlongtx
 
Automated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and JenkinsAutomated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and Jenkins
walkerchang
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeHolasz Kati
 

What's hot (20)

JavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as codeJavaOne 2016 - Pipeline as code
JavaOne 2016 - Pipeline as code
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
 
Apache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT AcademyApache Maven for SoftServe IT Academy
Apache Maven for SoftServe IT Academy
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in Maven
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
 
Release With Maven
Release With MavenRelease With Maven
Release With Maven
 
Maven ppt
Maven pptMaven ppt
Maven ppt
 
Pipeline based deployments on Jenkins
Pipeline based deployments  on JenkinsPipeline based deployments  on Jenkins
Pipeline based deployments on Jenkins
 
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home builtJenkins - Continuous Integration after Hudson, CruiseControl, and home built
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
 
Log management (elk) for spring boot application
Log management (elk) for spring boot applicationLog management (elk) for spring boot application
Log management (elk) for spring boot application
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
 
CI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins PipelineCI/CD on Android project via Jenkins Pipeline
CI/CD on Android project via Jenkins Pipeline
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01
 
Maven
MavenMaven
Maven
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 
Automated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and JenkinsAutomated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and Jenkins
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
 

Viewers also liked

Maven
MavenMaven
Maven
Shraddha
 
Sakai spring maven archetype
Sakai spring maven archetypeSakai spring maven archetype
Sakai spring maven archetype
gjenning
 
Maven tools & archetypes
Maven tools & archetypesMaven tools & archetypes
Maven tools & archetypes
Son Nguyen
 
Aparato locomotor
Aparato locomotorAparato locomotor
Aparato locomotor
Ulicer Martinez
 
Consejos para evitar ser infectado por virus
Consejos para evitar ser infectado por virusConsejos para evitar ser infectado por virus
Consejos para evitar ser infectado por virus
ALEX VALENZUELA
 
Effect of Social Isolation on the wellbeing of Older Persons in Uganda
Effect of Social Isolation on the wellbeing of Older Persons in UgandaEffect of Social Isolation on the wellbeing of Older Persons in Uganda
Effect of Social Isolation on the wellbeing of Older Persons in Uganda
Aharimpisya Dianah
 
Metodologia
MetodologiaMetodologia
Assessment
AssessmentAssessment
Assessment
brjack6
 
Звіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docx
Звіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docxЗвіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docx
Звіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docx
Kristina Bogachuk
 
Ict in latvia
Ict in latviaIct in latvia
Ict in latvia
Rafa
 
Potabilització
PotabilitzacióPotabilització
Potabilització
Eva_antonell
 
La cèl·lula
La cèl·lulaLa cèl·lula
La cèl·lula
Biologia i Geologia
 
Early school dropout lavia in greece
Early school dropout lavia in greeceEarly school dropout lavia in greece
Early school dropout lavia in greece
Rafa
 
E-Textiles
E-TextilesE-Textiles
E-Textiles
Anurag Chitti
 
【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現
【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現
【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現
Juniper Networks (日本)
 
3. İlk proqram və izahı
3. İlk proqram və izahı3. İlk proqram və izahı
3. İlk proqram və izahı
Software Development Fundamentals
 
Domenico manzo cv 2017
Domenico manzo cv 2017Domenico manzo cv 2017
Domenico manzo cv 2017
Domenico Manzo
 
JHLathamResume2017
JHLathamResume2017JHLathamResume2017
JHLathamResume2017Jimmy Latham
 
Pierfrancesco Bresolini - Brunello Cucinelli report
Pierfrancesco Bresolini - Brunello Cucinelli reportPierfrancesco Bresolini - Brunello Cucinelli report
Pierfrancesco Bresolini - Brunello Cucinelli report
Pierfrancesco Bresolini
 

Viewers also liked (20)

Maven
MavenMaven
Maven
 
Sakai spring maven archetype
Sakai spring maven archetypeSakai spring maven archetype
Sakai spring maven archetype
 
Maven tools & archetypes
Maven tools & archetypesMaven tools & archetypes
Maven tools & archetypes
 
Aparato locomotor
Aparato locomotorAparato locomotor
Aparato locomotor
 
Consejos para evitar ser infectado por virus
Consejos para evitar ser infectado por virusConsejos para evitar ser infectado por virus
Consejos para evitar ser infectado por virus
 
Effect of Social Isolation on the wellbeing of Older Persons in Uganda
Effect of Social Isolation on the wellbeing of Older Persons in UgandaEffect of Social Isolation on the wellbeing of Older Persons in Uganda
Effect of Social Isolation on the wellbeing of Older Persons in Uganda
 
Metodologia
MetodologiaMetodologia
Metodologia
 
Assessment
AssessmentAssessment
Assessment
 
Звіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docx
Звіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docxЗвіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docx
Звіт директора ТЗОШ №4 за звітний період з 20.05.2015 р. по 20.05.2016 р.docx
 
Ict in latvia
Ict in latviaIct in latvia
Ict in latvia
 
Potabilització
PotabilitzacióPotabilització
Potabilització
 
La cèl·lula
La cèl·lulaLa cèl·lula
La cèl·lula
 
Early school dropout lavia in greece
Early school dropout lavia in greeceEarly school dropout lavia in greece
Early school dropout lavia in greece
 
E-Textiles
E-TextilesE-Textiles
E-Textiles
 
【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現
【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現
【ネットワーク仮想化 事例セミナー 2017/2/28】ネットワンシステムズが目指すネットワーク仮想化によるセルフサービスITの実現
 
3. İlk proqram və izahı
3. İlk proqram və izahı3. İlk proqram və izahı
3. İlk proqram və izahı
 
Domenico manzo cv 2017
Domenico manzo cv 2017Domenico manzo cv 2017
Domenico manzo cv 2017
 
Proyecto e pumas
Proyecto e pumasProyecto e pumas
Proyecto e pumas
 
JHLathamResume2017
JHLathamResume2017JHLathamResume2017
JHLathamResume2017
 
Pierfrancesco Bresolini - Brunello Cucinelli report
Pierfrancesco Bresolini - Brunello Cucinelli reportPierfrancesco Bresolini - Brunello Cucinelli report
Pierfrancesco Bresolini - Brunello Cucinelli report
 

Similar to Apache_Maven

Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
Hsi-Kai Wang
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
Maven
MavenMaven
Maven
feng lee
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS world
Dmitry Bakaleinik
 
Maven basics
Maven basicsMaven basics
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management toolRenato Primavera
 
Java build tools
Java build toolsJava build tools
Java build toolsSujit Kumar
 
maven
mavenmaven
maven
akd11
 
Maven
MavenMaven
Maven
MavenMaven
Maven
MavenMaven
Maven
Emprovise
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
Sandeep Chawla
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Introboyw165
 
Maven
MavenMaven
Open Source tools overview
Open Source tools overviewOpen Source tools overview
Open Source tools overview
Luciano Resende
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
MD Sayem Ahmed
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
Raghavan Mohan
 

Similar to Apache_Maven (20)

Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
 
Maven
MavenMaven
Maven
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS world
 
Maven basics
Maven basicsMaven basics
Maven basics
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
 
Java build tools
Java build toolsJava build tools
Java build tools
 
maven
mavenmaven
maven
 
Maven
MavenMaven
Maven
 
P&MSP2012 - Maven
P&MSP2012 - MavenP&MSP2012 - Maven
P&MSP2012 - Maven
 
Maven nutshell
Maven nutshellMaven nutshell
Maven nutshell
 
Maven
MavenMaven
Maven
 
SWT Lab 1
SWT Lab 1SWT Lab 1
SWT Lab 1
 
Maven
MavenMaven
Maven
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Note - Apache Maven Intro
Note - Apache Maven IntroNote - Apache Maven Intro
Note - Apache Maven Intro
 
Maven
MavenMaven
Maven
 
Open Source tools overview
Open Source tools overviewOpen Source tools overview
Open Source tools overview
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
 

Apache_Maven