Skip to content

Apache Maven Tutorial

Apache Maven is a project-build automation tool popularly used for project-build automation, dependency management, project lifecycle management, and continuous integration.

Install Maven on Windows

Steps to install the Apache Maven tool on the Windows operating system:

Maven Setup

Setting up the MAVEN_HOME environment variable on the Windows 10 operating system. Install Maven Plugins.

 

Apache Maven Tutorial

Maven Plugins

Maven Repositories

Maven Project

Maven tool provides project templates that can be created with Maven’s Archetype Plugin.

 

Maven Project Structure

my-app/
|-- src/
| |-- main/
| | |-- java/
| | | `-- com/
| | | `-- example/
| | | `-- App.java
| | |-- resources/
| |-- test/
| |-- java/
| | `-- com/
| | `-- example/
| | `-- AppTest.java
| |-- resources/
|-- target/
|-- pom.xml

 

  • src/main/java: Contains Java source files.
  • src/main/resources: Contains resource files, configuration files, etc.
  • src/test/java: Contains test source files.
  • src/test/resources: Contains resources for testing.
  • target/: Directory where Maven puts the compiled files and packaged artifacts.
  • pom.xml: The Project Object Model file that defines the project configuration.

Build Life Cycle