(2) Maven installation and environment configuration, and maven installation environment Configuration
To install Apache Maven on Windows, you need to download the Maven zip file, decompress it to the directory you want to install, and configure Windows environment variables.
Required tools:
1. JDK
2. Maven
3. Windows 7
Note
Maven 3.2 requires JDK 1.6 or later, while Maven 3.0/3.1 requires JDK 1.5 or later.
1. JDK and JAVA_HOME
Make sure that you have installed JDK and added the "JAVA_HOME" variable to the Windows environment variable.
JDK installation and environment configuration will not be described much.
2. Download Apache Maven
: Http://maven.apache.org/download.html. Open the link and find the download link,
Alan is the old version of 3.0.4 that has been downloaded before. It is no problem to use it, so he is too lazy to download the latest version. You can download the latest version here.
Unzip the downloaded installation package to a specific directory, assuming you decompress it to the folder-D: \ apache-maven-3.0.4,
3. Add M2_HOME and MAVEN_HOME
M2_HOME or MAVEN_HOME
Maven only adds M2_HOME, but some projects still reference the Maven folder MAVEN_HOME. Therefore, it is added for security.
Alan is using M2_HOME.
4. Add to Environment Variable-PATH
Edit the PATH variable and add the Maven bin folder to the end of the PATH, for example, % M2_HOME % \ bin. Then you can run the Maven command in any directory of the command.
5. Verify
Enter mvn-version in the command line. The following interface is displayed, indicating that maven has been installed successfully.