This blog post will list down the steps on how we can install and configure Maven on a Windows machine.
1. Introduction
Maven is a project management and a build automation tool used primarily by Java programmers to manage the complete build life cycle of a project. Maven provides the following benefits:
- It manages the project dependencies in a central local directory, so the project doesn't need to store 3rd party libraries in source control.
- With Maven, you can add a new dependency quickly.
- Maven can automatically identify transitive dependencies, download, and include them in the project.
- Maven can use different plugins to do varying tasks such as generating JavaDoc, packaging the jar file, and more.
2. Installation
2.1 Download Maven from http://maven.apache.org/download.cgi.
2.2 Extract in c:/apache/maven. Make sure to rename the extracted folder apache-maven-3.6.3-bin to just maven.
3. Add MAVEN_HOME Environment Variable
Now we will add MAVEN_HOME Environment Variable. So that we can refer to this folder when we need to use Maven.
3.1 Open your Windows Explorer, right-click on This PC or My Computer and click Properties.
3.2 Click Advanced system settings / Environment Variables / New.
3.3 Enter Variable name=MAVEN_HOME and Variable value=c:\apache\maven. Click Ok.
4. Add Maven in Windows Environment Path
This will make the mvn command in c:/apache/maven/bin, available in the Windows terminal.
4.1 In the same view "Environment Variables", select Path and click Edit.
4.2 Click New, and in the new row enter: “%MAVEN_HOME%\bin”.

Post a Comment