In this post, We will talk and learn about How to install and setup Maven Environment on windows?
Maven is a build automation and dependency management tool for Java-based application development. One thing you should always keep in mind that Maven is not installed as a Windows service, instead it is configured using windows environment variables.
In this maven post, I am going to show you how to install maven on a Windows 10 64 bit machine.
Make sure that
JAVA_HOME the environment variable is set and points to your JDK installation
NOTE: Similar steps can be used for other windows operating system
First of all, you have to Download Maven Archive from the Apache website
Once You download Maven Archive, after that extract the archive to the directory you wish to install. In the extracted folder you will see files and folder as shown in the below image:
Now Let’s see how we can set up Maven HOME and PATH on windows.
Follow the below steps to install a maven on the windows operating system.
Windows environment variables location:
Right-click on MyComputer->Properties->Advanced system settings->Advanced->Environment Variables
- Right Click on your computer name ->Properties as shown in this Image:
2. Click on Advanced system settings
3. Select Advanced tab
4.Click on Environment Variables
5.Now you will get two sections in Environment Variables A). User Variables B). System variables, If You are working on a personal computer as an Administrator then you can set Maven HOME and PATH on either user or system level variables but If you are working on any organization then you might not have administrator privilege so You will have to set Maven HOME and PATH in User variables section.
Click on the New button in the User Variables section then provide Variable name: M2_HOME and Variable value:E:\Softwares\apache-maven-3.6.3-bin\apache-maven-3.6.3 —>(This value might differ in your case, Make sure that you are provided the correct path)
Finally, Click on the OK button
Again Click on the New button in the User variables section,
then provide Variable name: MAVEN_HOME and Variable value:E:\Softwares\apache-maven-3.6.3-bin\apache-maven-3.6.3 —>(This value might differ in your case, Make sure that you are provided correct path)
Finally, Click on the OK button
6. Now let’s set up the Maven path in the environment variables
To set up a maven path first of all you have to check if the Path variables already existing(if the path does not exist then click on New button in User Variables then provide Variable name:PATH or Path or path and Variable value:%MAVEN_HOME%\bin ) in the User variables section then select that Path and click on Edit and add maven path :E:\Softwares\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin as shown in the below image.
7. Now Final Step is to verify maven installation: Open Command Prompt and type mvn -v or mvn -version and press Enter, if you see similar output as below that means you are done with Maven HOME and PATH setup.
That’s all about How to install and setup Maven Environment on windows?
You May Also Like:
What is Maven?
Create a maven project using the command line
How to import the maven project in Eclipse?
How to Create a New Maven Project in Eclipse
How to create a maven web application project in Eclipse
How to create a multi-module project using maven?
How to Fix missing src/main/java & src/test/java folders in the Eclipse Maven web Project?
How to create user-defined properties in Maven?
What is the maven local repository location & how to change it?
How to add or update the maven settings.xml file in eclipse?
Importing maven remote Archetype Catalogs in eclipse ?
What is POM in the maven Project?
What is Super POM in Maven Project?
Understanding the purpose of Maven Plugin
Compiling the Maven project with different JDK versions?
Understanding of settings.xml in maven
How to enable a proxy setting in Maven?
Maven Dependency Scopes
How to generate javadoc in the maven Project
How to create a runnable JAR file with Maven?
How to add local jar files to a Maven project?
How to convert an existing Java Project to Maven in Eclipse?
How to exclude dependency in maven?
Managing External Dependencies in maven
Understanding of Maven Repositories
What is an archetype in Maven?
Snapshot Vs Version in maven
Apache Maven – Profiles
If you have any feedback or suggestion please feel free to drop in below comment box.