How to install Maven in CentOS

1, the official website to find the latest version of the installation package:
http://maven.apache.org/download.cgi

Copy files named * -bin.tar.gz link address;

2. Download
# Wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz

3, extract
# Tar xvf apache-maven-3.3.3-bin.tar.gz

If you need to: move to another directory
Establish flexible connection: # ln -s apache-maven-3.3.3 maven

4, configure the environment variables
# Vi / etc / profile

export M2_HOME = / usr / local / apache-maven
export PATH = $ PATH: $ M2_HOME / bin

# Source / etc / profile

5. Verify that the installation was successful
# Mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19: 57: 37 + 08: 00)
Maven home: / opt / app / maven
Java version: 1.8.0_51, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_51/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: “linux”, version: “3.10.0-229.el7.x86_64”, arch: “amd64”, family: “unix”