MAVEN is required to install because existing projects are packaged with MAVEN
1. Create a Directory
Mkdir/mavencd/maven
2, download the unzip maven, here choose Maven version for 3.5.3
wget HTTP://MIRRORS.HUST.EDU.CN/APACHE/MAVEN/MAVEN-3/3.5.3/BINARIES/APACHE-MAVEN-3.5.3-BIN.TAR.GZTAR-ZXVF Apache-maven-3.5.3-src.tar.gz
3. Configure Environment variables
Vi/etc/profile
Copy the following content
Maven_home=/maven/apache-maven-3.5.3export Maven_homeexport Path=${path}:${maven_home}/bin
4. Save Refresh Configuration
Source/etc/profile
5. View Maven Version
Mvn-v
The following appears to indicate that the installation is correct
Apache maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24t14:49:05-05:00) maven home:/maven/ Apache-maven-3.5.3java version:1.8.0_171, Vendor:oracle Corporationjava home:/usr/lib/jvm/ Java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jredefault Locale:en_us, platform Encoding:utf-8os name: "Linux", Version: "3.10.0-327.el7.x86_64", Arch: "AMD64", Family: "Unix"
If-bash:mvn:command not found indicates a configuration file configuration path error, please check.
Installing MAVEN under Linux 7.2