In the tutorial, we show how to install Maven on Windows.
Environment:
– Windows 10
– Java 10
– Lastest Maven 3.5.4
Related posts:
– Maven Introduction – Part 1
– Maven Introduction – Part 2: Maven Repositories and Plugins
– Part 3: Maven Dependency Mechanism
– Maven Introduction – Part 4: Maven Build LifeCycle
– Unit Test – Maven skip test with SpringBoot
Installed Java
Maven is written in Java -> Make sure you had installed Java.
Check it by cmd: java -version
Install Maven on Windows
Before install maven, check cmd mvn -v
->
Download Maven
Go to https://maven.apache.org/download.cgi
-> Download latest Maven apache-maven-3.5.4-bin.zip
Install Maven
Extract it, we get a folder apache-maven-3.5.4
->
Copy whole folder apache-maven-3.5.4
to C:\Program Files
->
Go to Control Panel\All Control Panel Items\System
, choose Advanced system settings
.
Then add C:\Program Files\apache-maven-3.5.4\bin
to Path
variable ->
Finish the setup by press OK
to apply all settings.
Check mvn -v
->
Now Maven is installed successfully!