Easy Tutorial
❮ Maven Plugins Maven Build Life Cycle ❯

Maven Tutorial

Maven translates to "expert" or "professional" and is an open-source project developed in pure Java under Apache. Based on the Project Object Model (POM) concept, Maven can manage a project's build, reporting, and documentation from a central piece of information.

Maven is a project management tool that can build and manage Java projects and handle dependencies.

Maven can also be used to build and manage projects written in languages such as C#, Ruby, Scala, and others. It was originally a subproject of Jakarta but is now an independent Apache project managed by the Apache Software Foundation.


Prerequisites for Reading This Tutorial

This tutorial is mainly for beginners, helping them learn the basic functionalities of the Maven tool. After completing this tutorial, your expertise in Apache Maven will reach an intermediate level, allowing you to proceed to more advanced topics.

To read this tutorial, you need to have the following foundational knowledge: Java Basics.


Maven Features

Maven can help developers with the following tasks:


Convention Over Configuration

Maven advocates for a common standard directory structure and follows the principle of convention over configuration. It is recommended to adhere to this structure as follows:

Directory Purpose
${basedir} Contains pom.xml and all subdirectories
${basedir}/src/main/java Project's Java source code
${basedir}/src/main/resources Project's resources, such as property files, springmvc.xml
${basedir}/src/test/java Project's test classes, such as Junit code
${basedir}/src/test/resources Resources for testing
${basedir}/src/main/webapp/WEB-INF Web application files directory, containing web.xml, local images, JSP view pages
${basedir}/target Packaging output directory
${basedir}/target/classes Compilation output directory
${basedir}/target/test-classes Test compilation output directory
Test.java Maven automatically runs test classes that follow this naming convention
~/.m2/repository Maven's default local repository location

Maven Characteristics

❮ Maven Plugins Maven Build Life Cycle ❯