参考: linux上安装使用maven
下载链接:官网Download
解压。
在root用户下执行:
cd /opt
mkdir maven
chmod 755 /opt/maven
tar -zvxf apache-maven-[版本号]-bin.tar.gz
设置全局变量:
vi /etc/profile
M2_HOME=/opt/maven/apache-maven-3.2.1
export M2_HOME
PATH=$PATH:$M2_HOME/bin
export PATH
执行以下命令,启动配置:
source /etc/profile
使用以下命令检查是否安装完成:
mvn -version
2016/12/14