Windows环境下maven 安装与环境变量配置、maven配置阿里云源

1、配置环境变量

 

 

MAVEN_HOME
D:\data\apache-maven-3.8.4

编辑path

 

 

D:\data\apache-maven-3.8.4\bin

查看版本:

 2、maven配置阿里云源

maven构建项目默认使用的源在国外,在下载jar的时候,速度堪忧,一般为了提速,我们会配置为国内源,而国内源中数豆瓣和阿里云的源比较快。这里就设置为阿里云源。

配置文件就是maven安装目录的conf/settings.xml文件。我们编辑该文件,找到mirrors这一部分,取消第一个mirror的注释,然后添加阿里云源的配置:

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

  

 

 

 <id>aliyun</id>      <mirrorOf>central</mirrorOf>      <name>aliyun-nexus</name>      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>

posted @ 2022-01-25 11:30  庞某人  阅读(110)  评论(0编辑  收藏  举报