Jar Bar Guide to install Maven 3 on Windows by Yucca Nel

Maven is one of the most essential tools you can add to you environment as a Java

The Jar Bar and Maven

Maven is at the forefront of my developer tools when it comes to my development environment with VirtualBox. Not only does Maven abstract my Java projects from the IDE, but I can have different build profiles that target my host or guest. When using Maven in VirtualBox, you can share a single Maven install and repository between a host and guest. This is because Maven runs on the Java

Before Installing Maven

Maven needs Java to be installed, you can verify your java install in the command prompt with the java -version command. You also need to have a 'JAVA_HOME' environment variable that tells your system where Maven is. You can verify this variable through the echo %JAVA_HOME% command.

Download Maven

You can download Maven from here.

Jar Bar Maven Install Tutorial Windows Image 1

Extract the Maven package

Personally I keep everything I use as a developer in my %HOMEPATH%, but you can pick the perfect location for yourself. Use the inzip option in the context menu from Windows Explorer "Extract All..." function and target the location. The download should be found in your "Downloads" directory:

Jar Bar Maven Install Tutorial Windows Image 2

Add Maven to your PATH

Locate the bin directory within the Maven directory and add it to the PATH environment variable. using The jar BarPath tutorial as a reference if needed.

Add a Maven variable for your Maven install

Using the same tutorial from step 3, create a new 'M?_HOME' variable that points to the location of where you installed Maven. The variable name must match the version of Maven as follows: M2_HOME for Maven 2 and M3_HOME for Maven 3. In this case the value for the variable is the location of the Maven directory (the same as the one used in the PATH, but without the "\bin" at the end):

Restart Windows

If you set your Environment variable as System variables then you need to restart Windows. If the next step fails then attempt a restart.

Jar Bar Maven Install Tutorial Windows Image 3

Verify that you have tha correct Maven install

Running the maven -version command tells you your Maven and Java version if Maven is installed correctly.

Install Maven defaults}

Initially your Maven is worthless as it has nothing in the Maven repository on your local disk. Running the mvn install commeand will fetch some defaults that you can use to create some starter projects. Over time ths directory fills up as you use Maven.

Jar Bar video showing how to install Maven on Windows