Installation and configuration of Linux Maven-v3.8.6

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.
Insert image description here

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
Insert image description here

Guess you like

Origin blog.csdn.net/qq_39420519/article/details/126389538