Linux篇:Linux下部署maven

  1. 下载
    http://maven.apache.org/download.cgi
  2. 上传到Linux服务器上
  3. 解压
tar -xvf apache-maven-3.6.1-bin.tar
  1. 设置环境变量
    vi /etc/profile
export M2_HOME=/home/rsstest/tools/apache-maven-3.6.1
export PATH=$PATH:$M2_HOME/bin
  1. source /etc/profile
  2. 验证是否安装成功
mvn -version
#安装成功
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T12:00:29-07:00)
Maven home: /home/rsstest/tools/apache-maven-3.6.1
Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: /home/rsstest/tools/jdk1.8.0_211/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
>注意:/home/rsstest/tools/apache-maven-3.6.1是我的部署路径

你可能感兴趣的:(Linux篇:Linux下部署maven)