maven下载

下载地址:​​https://maven.apache.org/download.cgi​

jdk要求

maven在windows及linux环境下安装_maven



maven在windows及linux环境下安装_javascript_02

maven在windows下安装

 maven在windows及linux环境下安装_apache_03

解压到D盘

maven在windows及linux环境下安装_maven_04

修改配置文件

进入conf,打开settings.xml文件

指定本地仓库地址

maven在windows及linux环境下安装_apache_05

配置镜像地址

maven在windows及linux环境下安装_maven_06

最好就是阿里云:

<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

maven在windows及linux环境下安装_apache_07


修改path的值:;%MAVEN_HOME%\bin

maven在windows及linux环境下安装_maven_08

验证:mvn -version

maven在windows及linux环境下安装_maven_09

maven在linux下安装

安装包上传到linux服务器,解压

maven在windows及linux环境下安装_maven_10

maven在windows及linux环境下安装_maven_11

修改本地仓库地址

maven在windows及linux环境下安装_apache_12

默认为

maven在windows及linux环境下安装_javascript_13

改为

maven在windows及linux环境下安装_maven_14

配置镜像地址

<mirrors>
<mirror>
<id>aliyun</id>
<mirrorOf>*</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
</mirrors>



配置环境变量

maven在windows及linux环境下安装_maven_15


# maven
export MAVEN_HOME=/usr/local/apache-maven-3.6.1
export PATH=$MAVEN_HOME/bin:$PATH


maven在windows及linux环境下安装_maven_16

激活配置

source /etc/profile

maven在windows及linux环境下安装_maven_17

验证

maven在windows及linux环境下安装_apache_18

maven在windows及linux环境下安装_maven_19


声明:如有侵权,请联系删除。

============================= 升职加薪 ==========================