linux安装maven3.8.6
maven 官网地址:https://maven.apache.org/download.cgi
把下载好的maven包上传至app
解压 maven包 tar -zxvf xx
修改解压后的文件名为maven
进入conf目录 创建资源文件夹
/m2/repository
修改setting文件
将原来的删除,
快速删除,先试用G命令,到达文件底部,在使用
:1,.d
删除全部
增加新的配置,修改了仓库地址和阿里云镜像地址
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<localRepository>/m2/repository</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profiles>
</profiles>
</settings>
修改环境变量
vi /etc/profile
MAVEN_HOME=/app/maven
PATH=$MAVEN_HOME/bin:$PATH
export MAVEN_HOME PATH
使配置文件生效
source /etc/profile
验证是否安装成功
mav -version
ok