A few months later .. It was a busy couple of months. Recently, we were working on the CAS identity authentication system. The new version of CAS needs to be built using Maven, so we need to study Maven-related materials. The first step is to download and install Maven. Maven can be easily installed on the local machine according to the official website documentation. The procedure is as follows:
- Download the built project from the official download page (you can also get the source code back to your own build) http://maven.apache.org/download.cgi (I downloaded the marked red box that)
- Check the JDK environment. To run Maven, you must install JDK. Only JRE does not work. JDK requires 1.5 or an updated version. (It doesn't matter if you can use jdk1.3 in earlier versions to compile maven)
- Decompress the downloaded zip package, which contains a apache-maven-3.1. × folder, which I putC: \ Program Files \ Apache Software FoundationDirectory
- Set environment variables. (You can use the win key and pause key combination to open the system System Properties window. I only know it today ..)
1) Add the m2_home variable value in the system variable to the path of apache-maven-3.1. × just now, my is c: \ Program Files \ Apache Software Foundation \ apache-maven-3.1.0. For Maven 2.0.9, make sure that the path does not end with the '\' symbol.
2) Add User VariablesM2 variable value: % m2_home % \ bin
3) this step is optional. Add the maven_opts variable to the user variable to set JVM parameters. For example, set the value to-xms256m-xmx512m.
4) Update the PATH variable in the user variable (if not, create one). The added value % M2 % and the previous value (if any) are separated ';'.
5) Make sure that the java_home variable has been set (pointing to the JDK installation directory) and in the PATH variable (the path in the user variable or in the system variable) the Value % java_home % \ bin exists.
- Open the command window win + R and Enter cmd. In the command line window, enter the command MVN -- version to view information about the installed maven. If the information is correct, the installation will come to an end.