Apache Maven on Windows
Download Maven’s zip file from Maven official website. Unzip the zip to the directory you wish to install.
Make sure JDK is installed, and “JAVA_HOME” variable is added as Windows environment variable.
C:UsersSree>java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) C:UsersSree>
Add M2_HOME and MAVEN_HOME in environment variables.
Click on New button and add variables.
Append Maven bin folder to PATH variable, so that we can run the Maven’s command everywhere. Select Path variable and click on Edit button.
Click on New button, add %M2_HOME%bin and click on OK.
Click on OK –> OK to close. Open command prompt and run “mvn -version” to verify.
C:UsersSree>mvn -version Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T13:28:13+05:30) Maven home: D:SoftwaresBuild Toolsapache-maven-3.5.2bin.. Java version: 1.8.0_45, vendor: Oracle Corporation Java home: C:Program FilesJavajdk1.8.0_45jre Default locale: en_IN, platform encoding: Cp1252 OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows" C:UsersSree>
If you see a similar message, the Apache Maven is installed successfully on Windows.