1. Download maven
wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
2, extract to/usr/local directory
TAR-ZXVF apache-maven-3.2.5-bin.tar.gz
3, the source of the allocation of domestic
Add the following in mirrors
<mirror>
<id>nexus-osc</id>
<mirrorOf>*</mirrorOf>
<name>nexus osc</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</ Mirror>
4. Configure environment variable Etc/profile finally add the following two lines
Export maven_home=/usr/local/apache-maven-3.2.5
Export Path=${path}:${maven_home}/bin
5, testing
[Root@localhost ~]# mvn-v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14t09 : 29:23-08:00)
Maven home:/usr/local/apache-maven-3.2.5
Java version:1.7.0_55, vendor:oracle Corporation
Java Home:/usr/java/jdk1.7.0_55/jre
Default Locale:en_us, platform encoding:utf-8
OS name: "Linux", Version: "2.6.32-431.el6.x86_64", Arch: "AMD64", fam ily: "Unix
6, about the location of the local warehouse
Default location: ${user.home}/.m2/repository
Windows:c:\documents and SETTINGS\ADMINISTRATOR\.M2
Linux:/root/.m2