Maven installation on Microsoft Windows - H Y R Tutorials

Maven installation on Microsoft Windows

Share This
Maven installation on Microsoft Windows
Maven is a build automation tool used primarily for Java projects.
Maven addresses two aspects of building software: first, it describes how software is built, and second, it describes its dependencies.
Maven is developed by Apache software foundation, and it is first released in 13 July 2004.

Downloading of Maven

Maven can be downloaded from the official website: https://maven.apache.org/download.html
When downloading maven, you can download the latest available version of maven.
While creating this post the latest version of maven is maven 3 (maven 3.6.2).
Maven is distributed in several formats for your convenience. Simply pick a ready-made binary distribution archive and follow the installation steps.

Note: Use a source archive if you intend to build Maven yourself.

Maven installation on Microsoft Windows

Installation of Maven

Maven installation is very easy, in next 5 mins you will be ready to perform these steps in your computer.

Before installing the maven make sure the following pre-requisites are fulfilled:
  • As maven is a java tool, make sure you have installed the java jdk.
  • Ensure JAVA_HOME environment variable is set and points to your JDK installation.
Installation steps:
Step 1: Unzip the downloaded binary distribution/source distribution archive.
Step 2: Once you’ve unzipped Maven to the installation directory, you will need to set the PATH environment variable. You can run the following commands in command prompt:
C:\windows\system32 > set PATH=%PATH%;"c:\apache-maven-3.6.1\bin"
(This is a temporary way of installation, once the command prompt is closed the path will be reset to its previous original one)

For setting the path permanently, add the maven installation directory path to PATH variable from windows GUI.

Go to Control Panel-> All Control Panel Items-> System-> Advanced system settings -> System variables -> Environment variables
Modify the Path variable as shown below.

Maven installation on Microsoft Windows

That’s it maven installation is done.

To verify whether it is installed correctly or not, please run the below command in command prompt.
mvn –version
verify maven installation
If you get the message like above then you have installed the maven correctly.