maven

Download Apache Maven -- Maven

setting.xml 配置文件

XML 复制代码
<?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>D:\soft\repository</localRepository>
 <!-- 镜像加速配置 -->
  <mirrors>
    <!-- 阿里云镜像(仅代理中央仓库) -->
    <mirror>
      <id>aliyun-maven</id>
      <name>Aliyun Public Repository</name>
      <url>https://maven.aliyun.com/repository/public</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>

  <!-- 多仓库优先级配置 -->
  <profiles>
    <!-- 阿里云仓库 -->
    <profile>
      <id>aliyun-repos</id>
      <repositories>
        <repository>
          <id>aliyun-public</id>
          <url>https://maven.aliyun.com/repository/public</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>

    <!-- 华为云仓库 -->
    <profile>
      <id>huawei-repos</id>
      <repositories>
        <repository>
          <id>huawei-public</id>
          <url>https://repo.huaweicloud.com/repository/maven/</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <!-- 激活仓库顺序:阿里云 → 华为云 -->
  <activeProfiles>
    <activeProfile>aliyun-repos</activeProfile>
    <activeProfile>huawei-repos</activeProfile>
  </activeProfiles>

</settings>
相关推荐
小七rrrrr10 分钟前
动态规划法 - 53. 最大子数组和
java·算法·动态规划
自由的疯18 分钟前
在 Java IDEA 中使用 DeepSeek 详解
java·后端·架构
自由的疯24 分钟前
Java 通过接口方式使用 DeepSeek 详解
java·后端·trae
敲代码中32 分钟前
Maven入门到精通
java·maven
拂晓银砾1 小时前
Java数据结构-队列
java·数据结构
重生成为编程大王1 小时前
Java ConcurrentHashMap 深度解析
java·开发语言
阿华的代码王国1 小时前
【Android】适配器与外部事件的交互
android·xml·java·前端·后端·交互
MacroZheng1 小时前
还在用WebSocket实现即时通讯?试试MQTT吧,真香!
java·spring boot·后端
稚辉君.MCA_P8_Java1 小时前
豆包 Java的23种设计模式
java·linux·jvm·设计模式·kubernetes