Maven installation and getting started

       I have known Maven and ant for a long time, but I have not tried it because I am too lazy. It wasn't until after the Kingdee interview that I really realized that opportunities are always given to those who are prepared. Only then did I make up my mind to change myself, make myself move, and not be lazy.

 

First contact with Maven.

1. Maven installation

       Before installing Maven, first make sure that you have installed JDK. Maven can run on JDK1.4 and above.

       Maven 's download page: http://maven.apache.org/download.html , which contains various versions of Maven download files for different platforms. I downloaded: apache-maven-3.0.5-bin.zip, extracted it to: D:\program files (x86)\Maven3\apache-maven-3.0.5. Then configure Maven's environment variables (this is basically the same as configuring JDk).

       Note: When entering a command in cmd , Windows will first look for the executable file or script in the current directory. If it is not found, Windows will then traverse the path defined in the environment variable Path . Since we added %M2_HOME%\bin to Path , this %M2_HOME% actually refers to another variable we defined earlier, and its value is the Maven installation directory. So Windows will search the directory D:\bin\apache-maven-3.0\bin when executing the command , and that is where mvn executes the script.

           Then, open a new cmd window and enter the following command:

C:\Users\Administrator>echo %M2_HOME%
D:\program files (x86)\Maven3\apache-maven-3.0.5

C:\Users\Administrator>mvn -v
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51:
28+0800)
Maven home: D:\program files (x86)\Maven3\apache-maven-3.0.5
Java version: 1.6.0_21, vendor: Sun Microsystems Inc.
Java home: D:\program files (x86)\Java\jdk1.6.0_21\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"

 Oh, it has been successfully installed...

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326991913&siteId=291194637