Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last Updated: Mar 27, 2024
Difficulty: Easy

How to Install Maven on Windows

Leveraging ChatGPT - GenAI as a Microsoft Data Expert
Speaker
Prerita Agarwal
Data Specialist @
23 Jul, 2024 @ 01:30 PM

Introduction

Maven is an effective project management tool built on POM (project object model). It is used for project building, dependencies, and documentation. Projects written in C#, Scala, Ruby, etc., are built using Maven, a Java tool.

This blog will show how to install Maven on Windows in detail. Let's start going!

How to install maven on windows

Installation of Maven on Windows

Maven can be run on Windows, Linux, and MAC Operating Systems. Here, we will learn how to install Maven on Windows.

The steps below must be followed to install Maven on Windows:

1. Get Maven and extract it in your specific folder.

2.  Add the environment variables JAVA_HOME and MAVEN_HOME.

3.  Include the maven path in an environment variable.

4.  Verify the Maven.

Downloading Maven on Windows

Maven can be downloaded by visiting the Apache Maven website to download the most recent version of Maven, and then choose the Maven zip file, such as apache-maven-3.8.6-bin.zip, to install Maven on Windows.

Next, we unzip it and place it in the folder where Maven will reside.

maven setup

Adding Maven Home to the Environment Variable

Using system properties, we add the MAVEN_HOME variables to the Windows environment and point to our Maven folder.

Right-click on ThisPC -> properties -> Advanced System Settings -> Environment variables -> press the new button. For example, D:\apache-maven-3.8.6. It is shown given below in an image.

Adding Maven Home to the Environment Variable

Adding Maven Path to the Environment Path

Open a new tab. Set the Maven's path if the path isn't already set. Edit the path and add the maven path if it has already been set.

Maven's path must begin with %maven home%/bin. For instance, D:apache-maven-3.8.6\bin.

Adding Maven Path to the Environment Path

Verifying the Maven

Open the command line prompt and type the following command to see whether Maven is installed or not:

mvn –version

 

It will now show the maven version with the MAVEN_HOME.

Verifying the Maven

Finally, you have successfully installed Maven on your system.

Must Read Apache Server

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Frequently Asked Questions

Which locations are used to store Maven dependencies?

The JARs, dependency files, and other items that Maven downloads are all saved in the Maven local repository. It is a folder on the local machine that houses all of the artefacts locally.

What is MOJO?

Every plain Old Java Object (MOJO) created by Maven is an executable goal, and a plugin deals with how these MOJOs are distributed. Maven can add new functionalities with the help of MOJO. A MOJO in Maven refers to a single task component.

What does a snapshot mean in Maven?

A snapshot is a particular version of a project that displays its current development state. Maven pulls a snapshot of the project for each build from the remote repository.

What command is used to create a new project from a hard drive?

To begin a new project, use the -mvn archetype: create. The archetype is built after reading the source and resource files, the contents of its parameters, and other properties.

What does system dependency mean to you?

The phrase "system dependency" describes the dependence of the scope system. These dependencies are typically used to inform Maven of the dependencies the JDK or VM provides.

Conclusion 

Congratulations on finishing the blog! We have discussed how to install Maven on windows. We have discussed each step to install Maven on Windows Operating System.

We hope this blog has helped you enhance your knowledge of how to install Maven on windows. Do not stop learning! We recommend you read some of our maven articles: 

  1. Maven Interview Questions
  2. DropWizard- Setting up using Maven
  3. Introduction to Maven Command
     

Refer to our Guided Path to upskill yourself in DSACompetitive ProgrammingJavaScriptSystem Design, and many more! If you want to test your competency in coding, you may check out the mock test series and participate in the contests hosted on Coding Ninjas Studio!

But suppose you have just started your learning process and are looking for questions from tech giants like Amazon, Microsoft, Uber, etc. In that case, you must look at the problemsinterview experiences, and interview bundles for placement preparations.

We wish you Good Luck! 

Happy Learning!

Topics covered
1.
Introduction
2.
Installation of Maven on Windows
2.1.
Downloading Maven on Windows
2.2.
Adding Maven Home to the Environment Variable
2.3.
Adding Maven Path to the Environment Path
2.4.
Verifying the Maven
3.
Frequently Asked Questions
3.1.
Which locations are used to store Maven dependencies?
3.2.
What is MOJO?
3.3.
What does a snapshot mean in Maven?
3.4.
What command is used to create a new project from a hard drive?
3.5.
What does system dependency mean to you?
4.
Conclusion