centos7.6中安装Maven
一、获取maven
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
二、解压
tar -zxvf apache-maven-3.6.3-bin.tar.gz
三、修改配置文件
vi /etc/profile
export M2_HOME=/root/soft/apache-maven-3.6.3
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
source /etc/profile
四、配置maven
cd apache-maven-3.6.3/conf/
vim settings.xml
<localRepository>/root/repository</localRepository>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
五、验证
mvn -v