What is Maven?
Apache Maven is a software project management and comprehension tool. It uses the concept of a project object model (POM), Maven can manage a project’s build and reporting, and documentation from a central piece of information. MAVEN helps us in creating the project structure and managing and downloading the dependencies. We need to define the required dependencies in pom.xml.
- Maven 3.3+ require JDK 1.7 or above to execute
- Approximately 10MB is required for the Maven installation
Step 1 – To install Apache Maven on the window, we need to download Maven’s zip folder from the Official Maven Site. Download apache-maven-3.8.6-bin.zip.
Step 2 – Unzip the downloaded folder and then it will have below mentioned files. We do not need to install anything, just unzip the folder.
Step 3 – We need to configure MAVEN_HOME environment variable. Type – “View Adva” in the search option and we will see the option – View Advanced system setting.
Step 4 – In System Properties dialog, select Advanced tab and click on the Environment Variables button.
Step 5 – In “Environment variables” dialog, under Users variables, Clicks on the New button and add a MAVEN_HOME variable.
Step 6 – A dialog box will appear, mention Variable Name – MAVEN_HOME and Variable value – mention the path where the Apache folder is placed.
Step 7 – Add %MAVEN_HOME%\bin (full path till bin where maven is placed on your machine) to Path present under System variables. Click the New Button present in System Variable and add MAVEN_HOME\bin.
Step 8 – Once the Path is updated with %MAVEN_HOME%\bin. This is what it will look like.
Step 9 – We have to make sure that JDK is installed and the JAVA_HOME environment variable is configured. If the JAVA_HOME variable is not configured, then add JAVA_HOME just like MAVEN_HOME in User Variable within Environment Variables.
How to verify if Maven is install properly on your machine
Open command prompt and type mvn -version, then the screen should look something like as shown below screen
This confirms that Maven is installed successfully and configured on your machine.