1. Download
Apache-maven-3.6.3-bin.tar. gz requires Java >= 1.7
Maven.apache.org/download.cg…
2. Unzip
/usr/local/ maven-3.6.3-bin /usr/local/mavne/mv apache-maven-3.6.3-bin /usr/local/maven.tarCopy the code
3. Configure environment variables
Export MAVEN_HOME=/usr/local/maven export PATH=$PATH:$MAVEN_HOME/bin /etc/profileCopy the code
4. Modify the image configuration
vim /usr/local/maven/conf/settings.xml +158
<! Ali -- -- - > < mirror > < id > aliyunmaven < / id > < mirrorOf > * < / mirrorOf > < url > https://maven.aliyun.com/repository/public < / url > </mirror> <! Huawei --> <mirror> < ID >huaweicloud</ ID > < Mirror of >*</mirrorOf> <url>https://mirrors.huaweicloud.com/repository/maven/</url> </mirror>Copy the code
5. Test
mvn -v
Copy the code
6. Reference
Maven.apache.org/install.htm…