# Maven settings.xml 配置文件模板

settings.xml,位于 maven 安装目录下的 conf/settings.xml

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <!-- 本地仓库路径,默认值:${user.home}/.m2/repository -->
  <localRepository>D:\tools\maven\repository</localRepository>

  <!-- 配置 maven 仓库镜像 -->
  <mirrors>
  
    <!-- (主用)华为云镜像 -->
    <mirror>
      <id>huaweicloud</id>
      <mirrorOf>*</mirrorOf>
      <url>https://mirrors.huaweicloud.com/repository/maven/</url>
    </mirror>

    <!-- (备用)阿里云镜像 -->
	<!--
    <mirror>
      <id>ali</id>
      <name>ali Maven</name>
      <mirrorOf>*</mirrorOf>
      <url>https://maven.aliyun.com/repository/public/</url>
    </mirror>
	-->

  </mirrors>

</settings>

参考资料:

阿里云Maven仓库配置 (opens new window)

华为Maven仓库配置 (opens new window)