maven下载
下载地址:https://maven.apache.org/download.cgi
jdk要求
maven在windows下安装
解压到D盘
修改配置文件
进入conf,打开settings.xml文件
指定本地仓库地址
配置镜像地址
最好就是阿里云:
<mirrors>
<mirror>
<id>aliyun</id>
<mirrorOf>*</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
</mirrors>
如果有多个镜像仓库,id要不一样,也就是说id要唯一 mirrorOf里面,*表示所有访问都使用该镜像仓库 name可以随便命名
新建系统变量:MAVEN_HOME=D:\apache-maven-3.6.1
修改path的值:;%MAVEN_HOME%\bin
验证:mvn -version
maven在linux下安装
安装包上传到linux服务器,解压
修改本地仓库地址
默认为
改为
配置镜像地址
<mirrors>
<mirror>
<id>aliyun</id>
<mirrorOf>*</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
</mirrors>
配置环境变量
# maven
export MAVEN_HOME=/usr/local/apache-maven-3.6.1
export PATH=$MAVEN_HOME/bin:$PATH
激活配置
source /etc/profile
验证
声明:如有侵权,请联系删除。
============================= 升职加薪 ==========================