Installation and configuration of Maven-v3.8.6
Official website download page address
Maven relies on the jdk environment and requires jdk1.7 or above. You need to configure the JAVA_HOME environment variable before installation.
If necessary, you can refer to the previous installation and environment variable configuration of JDK 11.
1. Download and unzip
$ wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz
$ cp apache-maven-3.8.6-bin.tar.gz /usr/local
$ cd /usr/local
$ tar -zxvf apache-maven-3.8.6-bin.tar.gz
After decompression, you can see that there is no need to compile and install. You can directly configure the environment variables.
2. Configure global environment variables and verify
$ vim /etc/profile
# 添加以下path
export PATH=/usr/local/apache-maven-3.8.6/bin:$PATH
Esc
:wq
$ source /etc/profile
$ mvn --version
Test OK