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>
相关推荐
维天说1 小时前
CLI-Switch 2026年3月版历史设计:Hook、TTY 隔离与 JSON 状态
java·服务器·json
Zane19942 小时前
并发 vs 并行:别再傻傻分不清了,一文讲透 Java 并发编程的第一课
java·后端
噢,我明白了2 小时前
java中Excel的导入和导出(EasyExcel)
java·开发语言·excel
吠品2 小时前
Zabbix Web界面误报Server未运行的排查与解决
java·服务器·数据库
啊湘2 小时前
天气查询API接口 按月Token鉴权 实时天气 物联网可用 文档齐全
java·后端·struts
Java内核笔记3 小时前
告别十亿美元的错误 : Spring Boot 4 空安全 (JSpecify) 实战
java·spring boot·后端
糖果店的幽灵3 小时前
langgraph的 MessagesState 解读
java·开发语言·人工智能·windows·langgraph
极光代码工作室4 小时前
基于SpringBoot的在线博客系统
java·springboot·web开发·后端开发
我是唐青枫5 小时前
Java Spring Security 实战详解:从登录认证到 JWT 权限控制
java·spring
ihuyigui5 小时前
海外签收通知短信接口
android·java·开发语言·前端·数据库·后端