25.DevOps:How to install Apache-Maven for Windows 10 ?

Apache-Maven Logo

With reference to my previous blog for Maven installation on Ubuntu:
https://vskumar.blog/2018/05/05/21-devops-how-to-install-maven-3-3-9-on-ubuntu-linux/

In this blog, I have shown the steps for Maven installation on
Windows 10.

Step1:
Goto the site: http://maven.apache.org/download.cgi
You can find the file: apache-maven-3.5.3-bin.zip
Save it to your desired location.

Step2:
Unzip it and it show have created the folder as below:
E:\apache-maven-3.5.3-bin

Note: You can replace this folder path with your Maven path.

It should have the following files/folders:

E:\apache-maven-3.5.3-bin>dir/p
Volume in drive E is New Volume
Volume Serial Number is 1870-3E6A

Directory of E:\apache-maven-3.5.3-bin

05/12/2018 01:40 PM <DIR> .
05/12/2018 01:40 PM <DIR> ..
05/12/2018 01:40 PM <DIR> apache-maven-3.5.3
0 File(s) 0 bytes
3 Dir(s) 33,347,407,872 bytes free

E:\apache-maven-3.5.3-bin>
E:\apache-maven-3.5.3-bin>cd apache*
E:\apache-maven-3.5.3-bin\apache-maven-3.5.3>
E:\apache-maven-3.5.3-bin\apache-maven-3.5.3>dir/p
Volume in drive E is New Volume
Volume Serial Number is 1870-3E6A

Directory of E:\apache-maven-3.5.3-bin\apache-maven-3.5.3

05/12/2018 01:40 PM <DIR> .
05/12/2018 01:40 PM <DIR> ..
05/12/2018 01:40 PM <DIR> bin
05/12/2018 01:40 PM <DIR> boot
05/12/2018 01:40 PM <DIR> conf
05/12/2018 01:40 PM <DIR> lib
05/12/2018 01:40 PM 20,959 LICENSE
05/12/2018 01:40 PM 182 NOTICE
05/12/2018 01:40 PM 2,544 README.txt
3 File(s) 23,685 bytes
6 Dir(s) 33,347,407,872 bytes free

E:\apache-maven-3.5.3-bin\apache-maven-3.5.3>

Step3:
Let us update the windows system/environment variables:

Check for M2_HOME variable. If it is not there,
create a new one and add the below:
Variable Name : M2_HOME
Variable Value : E:\apache-maven-3.5.3-bin\apache-maven-3.5.3

In your system variables,
if you have MAVEN_HOME as avriable you need update its value also.
Now, append this path to your PATH variable also.

Step4:
Now, how to verify the installed Maven version ?:
Open a fresh windows command prompt.
Type mvn -version
You should see the screen output as below wuth its 3.5.3 version:
Microsoft Windows [Version 10.0.16299.431]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\Toshiba>mvn -version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T01:19:05+05:30)
Maven home: E:\apache-maven-3.5.3-bin\apache-maven-3.5.3
Java version: 9.0.1, vendor: Oracle Corporation
Java home: D:\Java\jdk-9.0.1
Default locale: en_US, platform encoding: Cp1252
OS name: “windows 10”, version: “10.0”, arch: “amd64”, family: “windows”

C:\Users\Toshiba>

If you are getting the above version display;

So it means you have the correct/latest Maven version in your machine.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s