To install maven on windows, you need to perform the following steps:
Download Maven and extract it
Add M2_HOME in the environment variable
Add maven path in the environment variable
Verify Maven
For a manual installation, you can download Maven from the following URL Maven Download page.
Download “Binary zip archive” from Download Page. Like – apache-maven-3.3.9-bin.zip
Unzip this ZIP file.
Right click on MyComputer -> properties -> Advanced System Settings -> Environment variables -> click new button.
Put the variable name “JAVA_HOME”.
Give JAVA SDK value in JAVA_HOME value. For me, it’s – C:\Program Files\Java\jdk1.8.0_31
Click on the “OK” button.
Right click on MyComputer -> properties -> Advanced System Settings -> Environment variables -> click new button.
Put the variable name “M2_HOME” or “MAVEN_HOME”.
The value of M2_HOME should be the home directory of maven. For me it’s – C:\apache-maven-3.3.9
Click on the “OK” button.
Right click on MyComputer -> properties -> Advanced System Settings -> Environment variables.
Find the path variable and click on the Edit button.
Now add %M2_HOME%/bin; to the path variable. Using this way, We are providing the Maven bin path in the path variable.
To verify whether maven is installed or not, open the command prompt and write:
mvn −version
Now it will display the version of maven and JDK including the maven home and java home.