The Windows binaries are available in two variants. This is what people usually use. This version of library is included in Apache Tomcat distributions. So, the download of Maven is actually very easy. Go to the Apache Maven download pageand choose the.zip or the.tar.gz file. Once downloaded, it is wise to check the sha512 checksums against the file to be sure you have a copy of the download that was not tampered with. Go to and click on the Download link. Links to the latest stable versions of Maven will be displayed. The binaries are available in both.zip and.tar.gz formats. Choose one of them. Apache Maven offers a comprehensive set of features to build, test, release, and deploy software projects and maintain enterprise development infrastructure. This book is a hands-on guide that enables you to explore the vast potential of Apache Maven, the leading software build tool.
Unzip the distribution archive, i.e. apache-maven-2.0.9-bin.zip to the directory you wish to install Maven 2.0.9. These instructions assume you chose 'C:Program FilesApache Software Foundation'. The subdirectory apache-maven-2.0.9 will be created from the archive.
Add the M2_HOME environment variable by opening up the system properties (WinKey + Pause), selecting the 'Advanced' tab, and the 'Environment Variables' button, then adding the M2_HOME variable in the user variables with the value 'C:Program FilesApache Software Foundationapache-maven-2.0.9'. Note: for Maven < 2.0.9, be sure that the M2_HOME doesn't have a ' as last character.
In the same dialog, add the M2 environment variable in the user variables with the value '%M2_HOME%bin'.
Optional: in the same dialog, add the MAVEN_OPTS environment variable in the user variables to specify JVM properties, e.g. the value '-Xms256m -Xmx512m'. This environment variable can be used to supply extra options to Maven.
In the same dialog, update/create the Path environment variable in the user variables with the value '%M2%;%Path%' to add maven available in the command line.
In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK, e.g. 'C:Program FilesJavajdk1.5.0_02' and that '%JAVA_HOME%bin' is in your Path environment variable.
Open a new command prompt (Winkey + R then type 'cmd') and run 'mvn --version' to verify that it is correctly installed.