<s>
Maven	B-Language
is	O
a	O
build	B-Application
automation	I-Application
tool	O
used	O
primarily	O
for	O
Java	B-Language
projects	O
.	O
</s>
<s>
Maven	B-Language
can	O
also	O
be	O
used	O
to	O
build	O
and	O
manage	O
projects	O
written	O
in	O
C#	B-Application
,	O
Ruby	B-Language
,	O
Scala	B-Application
,	O
and	O
other	O
languages	O
.	O
</s>
<s>
The	O
Maven	B-Language
project	O
is	O
hosted	O
by	O
the	O
Apache	O
Software	O
Foundation	O
,	O
where	O
it	O
was	O
formerly	O
part	O
of	O
the	O
Jakarta	B-Language
Project	I-Language
.	O
</s>
<s>
Maven	B-Language
addresses	O
two	O
aspects	O
of	O
building	O
software	O
:	O
how	O
software	O
is	O
built	O
and	O
its	O
dependencies	O
.	O
</s>
<s>
Unlike	O
earlier	O
tools	O
like	O
Apache	B-Application
Ant	I-Application
,	O
it	O
uses	O
conventions	O
for	O
the	O
build	O
procedure	O
.	O
</s>
<s>
An	O
XML	B-Protocol
file	O
describes	O
the	O
software	O
project	O
being	O
built	O
,	O
its	O
dependencies	O
on	O
other	O
external	O
modules	O
and	O
components	O
,	O
the	O
build	O
order	O
,	O
directories	O
,	O
and	O
required	O
plug-ins	B-Application
.	O
</s>
<s>
Maven	B-Language
dynamically	O
downloads	O
Java	B-Language
libraries	O
and	O
Maven	B-Language
plug-ins	B-Application
from	O
one	O
or	O
more	O
repositories	O
such	O
as	O
the	O
Maven	B-Language
2	O
Central	O
Repository	O
,	O
and	O
stores	O
them	O
in	O
a	O
local	O
cache	O
.	O
</s>
<s>
Maven	B-Language
is	O
built	O
using	O
a	O
plugin-based	O
architecture	O
that	O
allows	O
it	O
to	O
make	B-Application
use	O
of	O
any	O
application	O
controllable	O
through	O
standard	O
input	O
.	O
</s>
<s>
A	O
C/C	O
++	O
native	O
plugin	B-Application
is	O
maintained	O
for	O
Maven	B-Language
2	O
.	O
</s>
<s>
Alternative	O
technologies	O
like	O
Gradle	B-Language
and	O
sbt	B-Language
as	O
build	B-Application
tools	I-Application
do	O
not	O
rely	O
on	O
XML	B-Protocol
,	O
but	O
keep	O
the	O
key	O
concepts	O
Maven	B-Language
introduced	O
.	O
</s>
<s>
With	O
Apache	B-Language
Ivy	I-Language
,	O
a	O
dedicated	O
dependency	O
manager	O
was	O
developed	O
as	O
well	O
that	O
also	O
supports	O
Maven	B-Language
repositories	O
.	O
</s>
<s>
Apache	B-Language
Maven	I-Language
has	O
support	O
for	O
reproducible	B-Application
builds	I-Application
.	O
</s>
<s>
Maven	B-Language
,	O
created	O
by	O
Jason	O
van	O
Zyl	O
,	O
began	O
as	O
a	O
sub-project	O
of	O
Apache	O
Turbine	O
in	O
2002	O
.	O
</s>
<s>
In	O
July	O
2004	O
,	O
Maven	B-Language
's	O
release	O
was	O
the	O
critical	O
first	O
milestone	O
,	O
v1.0	O
.	O
</s>
<s>
Maven	B-Language
2	O
was	O
declared	O
v2.0	O
in	O
October	O
2005	O
after	O
about	O
six	O
months	O
in	O
beta	O
cycles	O
.	O
</s>
<s>
Maven	B-Language
3.0	O
was	O
released	O
in	O
October	O
2010	O
being	O
mostly	O
backwards	O
compatible	O
with	O
Maven	B-Language
2	O
.	O
</s>
<s>
Maven	B-Language
3.0	O
information	O
began	O
trickling	O
out	O
in	O
2008	O
.	O
</s>
<s>
After	O
eight	O
alpha	O
releases	O
,	O
the	O
first	O
beta	O
version	O
of	O
Maven	B-Language
3.0	O
was	O
released	O
in	O
April	O
2010	O
.	O
</s>
<s>
Maven	B-Language
3.0	O
has	O
reworked	O
the	O
core	O
Project	O
Builder	O
infrastructure	O
resulting	O
in	O
the	O
POM	O
's	O
file-based	O
representation	O
being	O
decoupled	O
from	O
its	O
in-memory	O
object	O
representation	O
.	O
</s>
<s>
This	O
has	O
expanded	O
the	O
possibility	O
for	O
Maven	B-Language
3.0	O
add-ons	O
to	O
leverage	O
non-XML	O
based	O
project	O
definition	O
files	O
.	O
</s>
<s>
Languages	O
suggested	O
include	O
Ruby	B-Language
(	O
already	O
in	O
private	O
prototype	O
by	O
Jason	O
van	O
Zyl	O
)	O
,	O
YAML	B-Protocol
,	O
and	O
Groovy	B-Application
.	O
</s>
<s>
Special	O
attention	O
was	O
given	O
to	O
ensuring	O
backward	O
compatibility	O
of	O
Maven	B-Language
3	O
to	O
Maven	B-Language
2	O
.	O
</s>
<s>
For	O
most	O
projects	O
,	O
upgrading	O
to	O
Maven	B-Language
3	O
will	O
not	O
require	O
any	O
adjustments	O
of	O
their	O
project	O
structure	O
.	O
</s>
<s>
The	O
first	O
beta	O
of	O
Maven	B-Language
3	O
saw	O
the	O
introduction	O
of	O
a	O
parallel	O
build	O
feature	O
which	O
leverages	O
a	O
configurable	O
number	O
of	O
cores	O
on	O
a	O
multi-core	O
machine	O
and	O
is	O
especially	O
suited	O
for	O
large	O
multi-module	O
projects	O
.	O
</s>
<s>
Maven	B-Language
projects	O
are	O
configured	O
using	O
a	O
Project	O
Object	O
Model	O
(	O
POM	O
)	O
,	O
which	O
is	O
stored	O
in	O
a	O
pom.xml-file	O
.	O
</s>
<s>
This	O
POM	O
only	O
defines	O
a	O
unique	O
identifier	O
for	O
the	O
project	O
(	O
coordinates	O
)	O
and	O
its	O
dependency	O
on	O
the	O
JUnit	B-Language
framework	O
.	O
</s>
<s>
Maven	B-Language
accomplishes	O
this	O
by	O
embracing	O
the	O
idea	O
of	O
Convention	B-Application
over	I-Application
Configuration	I-Application
,	O
that	O
is	O
,	O
Maven	B-Language
provides	O
default	O
values	O
for	O
the	O
project	O
's	O
configuration	O
.	O
</s>
<s>
The	O
directory	O
structure	O
of	O
a	O
normal	O
idiomatic	O
Maven	B-Language
project	O
has	O
the	O
following	O
directory	O
entries	O
:	O
</s>
<s>
Directory	O
name	O
Purpose	O
project	O
home	O
Contains	O
the	O
pom.xml	B-Language
and	O
all	O
subdirectories	O
.	O
</s>
<s>
src/main/java	O
Contains	O
the	O
deliverable	O
Java	B-Language
sourcecode	O
for	O
the	O
project	O
.	O
</s>
<s>
src/test/java	O
Contains	O
the	O
testing	O
Java	B-Language
sourcecode	O
(	O
JUnit	B-Language
or	O
TestNG	O
test	O
cases	O
,	O
for	O
example	O
)	O
for	O
the	O
project	O
.	O
</s>
<s>
The	O
command	O
mvn	O
package	O
will	O
compile	O
all	O
the	O
Java	B-Language
files	O
,	O
run	O
any	O
tests	O
,	O
and	O
package	O
the	O
deliverable	O
code	O
and	O
resources	O
into	O
target/my	O
-app-1.0.jar	O
(	O
assuming	O
the	O
artifactId	O
is	O
my-app	O
and	O
the	O
version	O
is	O
1.0	O
.	O
)	O
</s>
<s>
Using	O
Maven	B-Language
,	O
the	O
user	O
provides	O
only	O
configuration	O
for	O
the	O
project	O
,	O
while	O
the	O
configurable	O
plug-ins	B-Application
do	O
the	O
actual	O
work	O
of	O
compiling	O
the	O
project	O
,	O
cleaning	O
target	O
directories	O
,	O
running	O
unit	O
tests	O
,	O
generating	O
API	O
documentation	O
and	O
so	O
on	O
.	O
</s>
<s>
In	O
general	O
,	O
users	O
should	O
not	O
have	O
to	O
write	O
plugins	B-Application
themselves	O
.	O
</s>
<s>
Contrast	O
this	O
with	O
Ant	B-Application
and	O
make	B-Application
,	O
in	O
which	O
one	O
writes	O
imperative	O
procedures	O
for	O
doing	O
the	O
aforementioned	O
tasks	O
.	O
</s>
<s>
One	O
can	O
also	O
configure	O
individual	O
phases	O
of	O
the	O
build	O
process	O
,	O
which	O
are	O
implemented	O
as	O
plugins	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
one	O
can	O
configure	O
the	O
compiler-plugin	O
to	O
use	O
Java	B-Language
version	O
1.5	O
for	O
compilation	O
,	O
or	O
specify	O
packaging	O
the	O
project	O
even	O
if	O
some	O
unit	O
tests	O
fail	O
.	O
</s>
<s>
The	O
Super	O
POM	O
provides	O
default	O
configuration	O
,	O
such	O
as	O
default	O
source	O
directories	O
,	O
default	O
plugins	B-Application
,	O
and	O
so	O
on	O
.	O
</s>
<s>
Most	O
of	O
Maven	B-Language
's	O
functionality	O
is	O
in	O
plug-ins	B-Application
.	O
</s>
<s>
A	O
plugin	B-Application
provides	O
a	O
set	O
of	O
goals	O
that	O
can	O
be	O
executed	O
using	O
the	O
command	O
mvn	O
 [ plugin-name ] : [ goal-name ] 	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
Java	B-Language
project	O
can	O
be	O
compiled	O
with	O
the	O
compiler-plugin	O
'	O
s	O
compile-goal	O
by	O
running	O
mvn	O
compiler:compile	O
.	O
</s>
<s>
There	O
are	O
Maven	B-Language
plugins	B-Application
for	O
building	O
,	O
testing	O
,	O
source	O
control	O
management	O
,	O
running	O
a	O
web	O
server	O
,	O
generating	O
Eclipse	B-Application
project	O
files	O
,	O
and	O
much	O
more	O
.	O
</s>
<s>
Plugins	B-Application
are	O
introduced	O
and	O
configured	O
in	O
a	O
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1-section	O
of	O
a	O
pom.xml	B-Language
file	O
.	O
</s>
<s>
Some	O
basic	O
plugins	B-Application
are	O
included	O
in	O
every	O
project	O
by	O
default	O
,	O
and	O
they	O
have	O
sensible	O
default	O
settings	O
.	O
</s>
<s>
Maven	B-Language
's	O
lifecycle	O
concept	O
handles	O
this	O
issue	O
.	O
</s>
<s>
Plugins	B-Application
are	O
the	O
primary	O
way	O
to	O
extend	O
Maven	B-Language
.	O
</s>
<s>
Developing	O
a	O
Maven	B-Language
plugin	B-Application
can	O
be	O
done	O
by	O
extending	O
the	O
org.apache.maven.plugin.AbstractMojo	O
class	O
.	O
</s>
<s>
Example	O
code	O
and	O
explanation	O
for	O
a	O
Maven	B-Language
plugin	B-Application
to	O
create	O
a	O
cloud-based	O
virtual	O
machine	O
running	O
an	O
application	O
server	O
is	O
given	O
in	O
the	O
article	O
Automate	O
development	O
and	O
management	O
of	O
cloud	O
virtual	O
machines	O
.	O
</s>
<s>
One	O
of	O
Maven	B-Language
's	O
standard	O
lifecycles	O
is	O
the	O
default	O
lifecycle	O
,	O
which	O
includes	O
the	O
following	O
phases	O
,	O
in	O
this	O
order	O
:	O
</s>
<s>
Goals	O
provided	O
by	O
plugins	B-Application
can	O
be	O
associated	O
with	O
different	O
phases	O
of	O
the	O
lifecycle	O
.	O
</s>
<s>
When	O
the	O
mvn	O
test	O
command	O
is	O
executed	O
,	O
Maven	B-Language
runs	O
all	O
goals	O
associated	O
with	O
each	O
of	O
the	O
phases	O
up	O
to	O
and	O
including	O
the	O
"	O
test	O
"	O
phase	O
.	O
</s>
<s>
In	O
such	O
a	O
case	O
,	O
Maven	B-Language
runs	O
the	O
"	O
resources:resources	O
"	O
goal	O
associated	O
with	O
the	O
"	O
process-resources	O
"	O
phase	O
,	O
then	O
"	O
compiler:compile	O
"	O
,	O
and	O
so	O
on	O
until	O
it	O
finally	O
runs	O
the	O
"	O
surefire:test	O
"	O
goal	O
.	O
</s>
<s>
Maven	B-Language
also	O
has	O
standard	O
phases	O
for	O
cleaning	O
the	O
project	O
and	O
for	O
generating	O
a	O
project	O
site	O
.	O
</s>
<s>
Standard	O
lifecycles	O
enable	O
users	O
new	O
to	O
a	O
project	O
the	O
ability	O
to	O
accurately	O
build	O
,	O
test	O
and	O
install	O
every	O
Maven	B-Language
project	O
by	O
issuing	O
the	O
single	O
command	O
mvn	O
install	O
.	O
</s>
<s>
By	O
default	O
,	O
Maven	B-Language
packages	O
the	O
POM	O
file	O
in	O
generated	O
JAR	O
and	O
WAR	O
files	O
.	O
</s>
<s>
Tools	O
like	O
diet4j	O
can	O
use	O
this	O
information	O
to	O
recursively	O
resolve	O
and	O
run	O
Maven	B-Language
modules	O
at	O
run-time	O
without	O
requiring	O
an	O
"	O
uber	O
"	O
-jar	O
that	O
contains	O
all	O
project	O
code	O
.	O
</s>
<s>
A	O
central	O
feature	O
in	O
Maven	B-Language
is	O
dependency	O
management	O
.	O
</s>
<s>
Maven	B-Language
's	O
dependency-handling	O
mechanism	O
is	O
organized	O
around	O
a	O
coordinate	O
system	O
identifying	O
individual	O
artifacts	O
such	O
as	O
software	O
libraries	O
or	O
modules	O
.	O
</s>
<s>
The	O
POM	O
example	O
above	O
references	O
the	O
JUnit	B-Language
coordinates	O
as	O
a	O
direct	O
dependency	O
of	O
the	O
project	O
.	O
</s>
<s>
A	O
project	O
that	O
needs	O
,	O
say	O
,	O
the	O
Hibernate	B-Library
library	O
simply	O
has	O
to	O
declare	O
Hibernate	B-Library
's	O
project	O
coordinates	O
in	O
its	O
POM	O
.	O
</s>
<s>
Maven	B-Language
will	O
automatically	O
download	O
the	O
dependency	O
and	O
the	O
dependencies	O
that	O
Hibernate	B-Library
itself	O
needs	O
(	O
called	O
transitive	O
dependencies	O
)	O
and	O
store	O
them	O
in	O
the	O
user	O
's	O
local	O
repository	O
.	O
</s>
<s>
Maven	B-Language
2	O
is	O
used	O
by	O
default	O
to	O
search	O
for	O
libraries	O
,	O
but	O
one	O
can	O
configure	O
the	O
repositories	O
to	O
be	O
used	O
(	O
e.g.	O
,	O
company-private	O
repositories	O
)	O
within	O
the	O
POM	O
.	O
</s>
<s>
The	O
fundamental	O
difference	O
between	O
Maven	B-Language
and	O
Ant	B-Application
is	O
that	O
Maven	B-Language
's	O
design	O
regards	O
all	O
projects	O
as	O
having	O
a	O
certain	O
structure	O
and	O
a	O
set	O
of	O
supported	O
task	O
work-flows	O
(	O
e.g.	O
,	O
getting	O
resources	O
from	O
source	O
control	O
,	O
compiling	O
the	O
project	O
,	O
unit	O
testing	O
,	O
etc	O
.	O
)	O
.	O
</s>
<s>
While	O
most	O
software	O
projects	O
in	O
effect	O
support	O
these	O
operations	O
and	O
actually	O
do	O
have	O
a	O
well-defined	O
structure	O
,	O
Maven	B-Language
requires	O
that	O
this	O
structure	O
and	O
the	O
operation	O
implementation	O
details	O
be	O
defined	O
in	O
the	O
POM	O
file	O
.	O
</s>
<s>
Thus	O
,	O
Maven	B-Language
relies	B-Application
on	I-Application
a	I-Application
convention	I-Application
on	O
how	O
to	O
define	O
projects	O
and	O
on	O
the	O
list	O
of	O
work-flows	O
that	O
are	O
generally	O
supported	O
in	O
all	O
projects	O
.	O
</s>
<s>
The	O
Maven	B-Language
command	O
mvn	O
install	O
builds	O
a	O
project	O
and	O
places	O
its	O
binaries	O
in	O
the	O
local	O
repository	O
.	O
</s>
<s>
Add-ons	O
to	O
several	O
popular	O
integrated	B-Application
development	I-Application
environments	I-Application
(	O
IDE	O
)	O
targeting	O
the	O
Java	B-Language
programming	I-Language
language	I-Language
exist	O
to	O
provide	O
integration	O
of	O
Maven	B-Language
with	O
the	O
IDE	O
's	O
build	O
mechanism	O
and	O
source	O
editing	O
tools	O
,	O
allowing	O
Maven	B-Language
to	O
compile	O
projects	O
from	O
within	O
the	O
IDE	O
,	O
and	O
also	O
to	O
set	O
the	O
classpath	O
for	O
code	O
completion	O
,	O
highlighting	O
compiler	O
errors	O
,	O
etc	O
.	O
</s>
<s>
Examples	O
of	O
popular	O
IDEs	O
supporting	O
development	O
with	O
Maven	B-Language
include	O
:	O
</s>
<s>
For	O
example	O
,	O
Eclipse	B-Application
's	O
JDT	O
has	O
the	O
ability	O
to	O
recompile	O
a	O
single	O
Java	B-Language
source	O
file	O
after	O
it	O
has	O
been	O
edited	O
.	O
</s>
<s>
Many	O
IDEs	O
work	O
with	O
a	O
flat	O
set	O
of	O
projects	O
instead	O
of	O
the	O
hierarchy	O
of	O
folders	O
preferred	O
by	O
Maven	B-Language
.	O
</s>
<s>
This	O
complicates	O
the	O
use	O
of	O
SCM	O
systems	O
in	O
IDEs	O
when	O
using	O
Maven	B-Language
.	O
</s>
