2. Maven’s primary goal is to allow a developer to
comprehend the complete state of a development
effort in a short time
In order to attain this goal, Maven deals with several
areas of concern:
Making the build process easy
Providing a uniform build system
Providing quality project information
Encouraging better development practices
3. INSTALLING MAVEN
Set the JAVA_HOME environment variable to point to a valid
Java SDK (e.g. Java 8).
Download and unzip Maven from http://maven.apache.org
Set the M2_HOME environment variable to point to the
directory you unzipped Maven to.
Set the M2 environment variable to point to
M2_HOME/bin (%M2_HOME%bin on Windows).
Add M2 to the PATH environment variable (%M2% on Windows).
Open a command prompt and type 'mvn -version' (without
quotes) and press enter.
5. A Maven POM file (Project Object Model) is an XML file that describe the resources of the
project.
This includes the directories where the source code, test source etc. is located in, what
external dependencies (JAR files) your projects has etc.
Maven POM Files
• All Maven POM files inherit
from a super POM.
• If no super POM is specified,
the POM file inherits from
the base POM.
6. MAVEN DIRECTORY STRUCTURE
- src
- main
- java
- resources
- test
- java
- resources
- target
Root directory of your source code and test code
Contains the source code related to the application itself
Java codes of the application
Java codes for the tests
Resources needed
Resources needed
Compiled classes, JAR files etc. produced by Maven
7. MAVEN REPOSITORIES
Local Repository - By default located in
user-home/.m2
Central Repository - Provided by the
Maven community
Remote Repository - Can be located
anywhere on the internet, or inside a local
network