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>
相关推荐
014-code5 小时前
订单超时取消与库存回滚的完整实现(延迟任务 + 状态机)
java·开发语言
java1234_小锋6 小时前
Java高频面试题:Springboot的自动配置原理?
java·spring boot·面试
末央&7 小时前
【天机论坛】项目环境搭建和数据库设计
java·数据库
枫叶落雨2227 小时前
ShardingSphere 介绍
java
花花鱼8 小时前
Spring Security 与 Spring MVC
java·spring·mvc
言慢行善8 小时前
sqlserver模糊查询问题
java·数据库·sqlserver
专吃海绵宝宝菠萝屋的派大星8 小时前
使用Dify对接自己开发的mcp
java·服务器·前端
大数据新鸟9 小时前
操作系统之虚拟内存
java·服务器·网络
Tong Z9 小时前
常见的限流算法和实现原理
java·开发语言
凭君语未可9 小时前
Java 中的实现类是什么
java·开发语言