Install And Configure Maven In Simple Steps

 

 

 

In this article will be looking at how to install and configure Maven on our machine. First of all to install Maven click on the link here and navigate to downloads section as shown below.


Installing Maven:

 

Before installing maven, please do make sure to have JAVA installed and configure the environment variables accordingly as this is the only pre-requisite for installing Maven. Now select the appropriate version and click on the download link.

Once Maven is downloaded, extract the contents and place it in a folder something similar to the below one

 



Updating Environment Variables:

 

Now in order to let your system know that you have installed maven and also to enable Maven from command line irrespective of the location, you need to configure the environment variables.

 

Right click on This PC icon in case if you are using Windows 10 operating system or on your computer icon and select Properties option. From the properties window click on Advanced Environment Variables followed by Environment Variables as shown below.

 


 

Now under system variables make a new entry with Variable Name as M2_HOME and Variable value as “Maven_installation_path” as highlighted below.

 


 

Now edit the Path variable and provide the complete installation path of your Maven, including the bin directory.

 


 Click on OK button and close all the relevant windows.


Validate Maven Installation:


Now that we have successfully installed and configured Maven, lets do a quick check on the same. For that, invoke your command line by typing cmd in the Windows Run prompt and type the following


mvn -v


You should be able to see an output similar to the below.

 


Congratulations…!! You have successfully installed and configured Maven on your machine. 


In my next article will look at how to create project using maven commands alone. Until then stay tuned and happy learning..!! 

 

Install And Configure Maven In Simple Steps Install And Configure Maven In Simple Steps Reviewed by Suntaragali The Smart Techie on May 20, 2020 Rating: 5

No comments: