Linux 安装Maven

  1. 进入到下载目录:cd /usr/local

  2. 下载:wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

  3. 解压 ,maven不需要安装直接解压就行:tar -zxvf apache-maven-3.6.3-bin.tar.gz

  4. 配置仓库:

    <mirror>

    <id>alimaven</id>

    <name>aliyun maven</name>

    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>

    <mirrorOf>central</mirrorOf>

    </mirror>

  5. 配置环境变量

    1. vim /etc/profile

    2. export MAVEN_HOME=/usr/local/apache-maven-3.6.3/

    3. export PATH=$MAVEN_HOME/bin:$PATH

    4. 文件生效:source /etc/profile

  6. 查看版本:mvn -v