很多教程都是下载…解压…修改配置…
其实在centos上只需要通过yum就可以完成安装

输入以下指令:

sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y maven

以上便安装结束了!
检查一下是否安装成功
mvn -version

看到以下信息,说明安装成功

Apache Maven 3.5.4 (Red Hat 3.5.4-5)
Maven home: /usr/share/maven
Java version: 1.8.0_222, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el8_0.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.18.0-80.11.2.el8_0.x86_64", arch: "amd64", family: "unix"

本博客所有文章除特别声明外,均采用 CC BY-SA 3.0协议 。转载请注明出处!

CentOS安装aapt【避坑指南】 上一篇
linux部署jar包开机自启 下一篇