1. First download the installation file to MAVEN official website, the latest version is 3.0.3, download file is apache-maven-3.0.3-bin.tar.gz, download can use wget command;
2. Go to the Download folder, locate the downloaded file, and run the following command to unzip
TAR-XVF apache-maven-2.2.1-bin.tar.gz
The extracted folder is named apache-maven-3.0.3
3. Use the MV command to copy the apache-maven-3.0.3 folder to the folder you specified, such as/usr/local/
MV-RF apache-maven-3.0.3/usr/local/
4. Configure the environment variables, edit the/etc/profile file, add the following code
Export Java_home=/usr/local/scan_web/java
Export maven_home=/usr/local/apache-maven-3.3.9
Export path= $MAVEN _home/bin: $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
5. Save the file and run the following command to make the environment variable effective
Source/etc/profile
6. In the console enter the following command, if you can see the MAVEN related version information, the MAVEN has been installed successfully
Mvn-v
CentOS Configuration maven Environment