1、下载maven:
https://maven.apache.org/download.cgi
2、上传maven到linux:
3、解压:
mkdir /usr/local/maven
cp apache-maven-3.6.0-bin.tar.gz /usr/local/maven
cd /usr/local/maven
tar -zxvf apache-maven-3.6.0-bin.tar.gz
4、配置settings.xml文件
<localRepository>D:\Repository</localRepository>
<mirror>
<id>aliyun</id>
<name>aliyun Maven</name>
<mirrorOf>*</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
5、配置环境变量:
vi /etc/profile
#maven environment
export MAVEN_HOME=/usr/local/maven/apache-maven-3.6.0
export PATH=$PATH:$MAVEN_HOME/bin