maven-安装(一)
下载
官网选择对应的版本
http://maven.apache.org/download.cgi
获得下载链接
通过wget进行下载
自己创建一个安装目录,并进入到安装目录进行下载
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
安装
解压
tar -xvf apache-maven-3.6.3-bin.tar.gz
配置profile
1.pwd获得目录地址
[root@centos-linux bin]# pwd
/home/maven/apache-maven-3.6.3/bin
2.配置/etc/profile
在最底部进行新增2行
vi /etc/profile
#此处配自己的安装目录
export MAVEN_HOME=/home/maven/apache-maven-3.6.3 export PATH=${MAVEN_HOME}/bin:${PATH}
3.刷新配置
source /etc/profile
4.查看是否安装成功
[root@centos-linux bin]# mvn -v Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /home/maven/apache-maven-3.6.3 Java version: 1.8.0_262, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-1127.el7.x86_64", arch: "amd64", family: "unix"