下载
wget https://dlcdn.apache.org/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz
#解压到 /usr/local
tar -zxvf maven_xxxx.tar.gz -C /usr/local
#修改配置
mv /usr/local/maven-xxx maven
mkdir ck
cd conf
vim setting.xml
#找到·localRepository下面复制一行加上<localRepository>/usr/local/apache-maven-3.6.3/ck</localRepository>
<localRepository>/usr/local/apache-maven-3.6.3/ck</localRepository>
#找到mirror 加上阿里的仓库配置
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
#配置环境变量
export MAVEN_HOME=/usr/local/maven
export PATH=$PATH:$MAVEN_HOME/bin
#验证安装是否成功
mvn -v