Maven Notes
Maven Notes
Maven is a powerful project management tool that is based on POM (project object
model). It is used for projects build, dependency and documentation. It simplifies the
build process like ANT. But it is too much advanced than ANT.
In short terms we can tell maven is a tool that can be used for building and managing
any Java-based project. maven make the day-to-day work of Java developers easier
and generally help with the comprehension of any Java-based 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>4.0.0</modelVersion>
<artifactId>LoggerApi</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
</project>
Maven Repository
Maven repositories are directories of packaged JAR files with some metadata.
The metadata are POM files related to the projects each packaged JAR file
belongs to, including what external dependencies each packaged JAR has.
This metadata enables Maven to download dependencies of your
dependencies recursively until all dependencies are download and put into
your local machine.
Maven has three types of repository :
1. Local repository
2. Central repository
3. Remote repository
Maven searches for dependencies in this repositories. First maven searches
in Local repository then Central repository then Remote repository if Remote
repository specified in the POM.
Step 12). Open POM.xml file and see that no Dependencies added in
pom.xml file
Step 15). Observe no Dependencies are added