Centos 7 配置maven

1. maven下载

    下载地址: https://maven.apache.org/download.cgi

Centos 7 配置maven

  保存到目录(个人习惯/usr/local/src)Centos 7 配置maven

cd /usr/local/src/

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

Centos 7 配置maven

 2. 解压

tar xzvf apache-maven-3.6.3-bin.tar.gz 

3. 编辑/etc/profile, 将maven添加至环境变量,添加如下两行,保存

export MAV_HOME=/usr/local/src/apache-maven-3.6.3/
export PATH=$PATH:${MAV_HOME}/bin

4. 使环境变量生效

source /etc/profile

5. 检查maven版本,查看配置是否成功

[ apache-maven-3.6.3]# mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/src/apache-maven-3.6.3
Java version: 11.0.1, vendor: Oracle Corporation, runtime: /usr/local/jdk-11.0.1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1062.1.2.el7.x86_64", arch: "amd64", family: "unix"

相关推荐