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

PDF
Automated Deployment with Maven - going the whole nine yards
PDF
Continuous delivery-with-maven
PPTX
Build Tools & Maven
PDF
Build Automation using Maven
PPTX
An introduction to Maven
PPTX
An Introduction to Maven
PDF
Introduction to Apache Maven
Automated Deployment with Maven - going the whole nine yards
Continuous delivery-with-maven
Build Tools & Maven
Build Automation using Maven
An introduction to Maven
An Introduction to Maven
Introduction to Apache Maven

What's hot (20)

PDF
JavaOne 2016 - Pipeline as code
PPTX
Continuous Deployment Pipeline with maven
PPTX
Apache Maven for SoftServe IT Academy
PPTX
Version Management in Maven
PPTX
Ci jenkins maven svn
PPTX
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
PPTX
Release With Maven
PPTX
Maven ppt
ODP
Pipeline based deployments on Jenkins
PPT
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
PPTX
Log management (elk) for spring boot application
PDF
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
PPTX
CI/CD on Android project via Jenkins Pipeline
PDF
7 Habits of Highly Effective Jenkins Users
PPTX
Introduction to Maven
PDF
Introduction maven3 and gwt2.5 rc2 - Lesson 01
PPTX
PPTX
Jenkins days workshop pipelines - Eric Long
PPTX
Automated Testing Environment by Bugzilla, Testopia and Jenkins
PPSX
Maven Presentation - SureFire vs FailSafe
JavaOne 2016 - Pipeline as code
Continuous Deployment Pipeline with maven
Apache Maven for SoftServe IT Academy
Version Management in Maven
Ci jenkins maven svn
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Release With Maven
Maven ppt
Pipeline based deployments on Jenkins
Jenkins - Continuous Integration after Hudson, CruiseControl, and home built
Log management (elk) for spring boot application
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
CI/CD on Android project via Jenkins Pipeline
7 Habits of Highly Effective Jenkins Users
Introduction to Maven
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Jenkins days workshop pipelines - Eric Long
Automated Testing Environment by Bugzilla, Testopia and Jenkins
Maven Presentation - SureFire vs FailSafe
Ad

Viewers also liked (20)

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

Similar to Apache_Maven (20)

PPTX
PPTX
Embrace Maven
PPTX
(Re)-Introduction to Maven
ODP
Maven in Java EE project
PPTX
Learning Maven by Example
PDF
Introduction to maven, its configuration, lifecycle and relationship to JS world
PPTX
Java build tools
PDF
Fundamental of apache maven
PDF
Apache maven
PDF
MAVEN - Short documentation
PDF
Java Builds with Maven and Ant
PPTX
PDF
Note - Apache Maven Intro
PDF
Intelligent Projects with Maven - DevFest Istanbul
PPTX
Maven
PPTX
Maven
PDF
BMO - Intelligent Projects with Maven
PDF
Practical maven-slides 2
PDF
Maven nutshell
Embrace Maven
(Re)-Introduction to Maven
Maven in Java EE project
Learning Maven by Example
Introduction to maven, its configuration, lifecycle and relationship to JS world
Java build tools
Fundamental of apache maven
Apache maven
MAVEN - Short documentation
Java Builds with Maven and Ant
Note - Apache Maven Intro
Intelligent Projects with Maven - DevFest Istanbul
Maven
Maven
BMO - Intelligent Projects with Maven
Practical maven-slides 2
Maven nutshell

Apache_Maven