1.下载Maven安装包
2.解压
tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /opt/module/

3.改名
mv apache-maven-3.6.3/ maven

4.配置环境变量
vi /etc/profile
修改内容
export M2_HOME=/opt/module/maven
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
使环境变量生效
source /etc/profile
5.验证
mvn -v

网友评论