How to Install Maven on Windows
In the previous post, we have learnt about Maven. In this post, we will see How to Install Maven on Windows.
Download Apache Maven:
Visit Apache Maven official website https://maven.apache.org/download.cgi. to download maven zip file apache-maven-3.3.3-bin.zip.
After downloading file, unzip it and store it at any desired location.You will be able to see the file as shown below. That’s why, we can say it is Maven configuration instead of Maven installation.
Note: You must have java configured at your system as we have seen in this post.
Configuring System Variable:
Step#1 In windows 7, right click on computer icon and go to properties.
Step#2 Go to Advance System settings, a new window will open where we need to click on a button called “Environment Variable“.
Step#3 We need to create a new system variable named as M2_HOME and its value should be the path where Maven unzipped file stored.
Step#4 This is optional step. You can create one more System variable named as MAVEN_HOME , and you can provide the same path into the value as given for M2_HOME.
Step#5 We need to add bin folder path of Maven to system variable path. Either you can use full path like C:\Personal\Tools\apache-maven-3.3.3\bin or %M2_HOME%\bin.
Add a semicolon (;) in the end of the path value, and add you Maven bin folder path.
Verify if Maven has been configured correctly:
Open a command window and type mvn –version and hit Enter.
If you see the message as shown below, that means Maven has been installed successfully.