linux环境下配置maven环境

1.下载maven包
wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz

2.解压
tar zxvf apache-maven-3.5.4-bin.tar.gz

3.配置环境变量

vim /etc/profile
export MAVEN_HOME=/data/jenkins/apache-maven-3.5.4
export PATH=$PATH:$MAVEN_HOME/bin

4.使之生效

source /etc/profile

5.校验

mvn -version

出现如下结果,即为成功

[root@iz8vbda2qfz3f1qw1b2e9cz jenkins]# mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: /data/jenkins/apache-maven-3.5.4
Java version: 1.8.0_131, vendor: Oracle Corporation, runtime: /data/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.2.2.el7.x86_64", arch: "amd64", family: "unix"

你可能感兴趣的:(maven)