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>
相关推荐
怒放吧德德4 小时前
Netty 4.2 入门指南:从概念到第一个程序
java·后端·netty
雨中飘荡的记忆6 小时前
大流量下库存扣减的数据库瓶颈:Redis分片缓存解决方案
java·redis·后端
心之语歌8 小时前
基于注解+拦截器的API动态路由实现方案
java·后端
华仔啊9 小时前
Stream 代码越写越难看?JDFrame 让 Java 逻辑回归优雅
java·后端
ray_liang9 小时前
用六边形架构与整洁架构对比是伪命题?
java·架构
Ray Liang11 小时前
用六边形架构与整洁架构对比是伪命题?
java·python·c#·架构设计
Java水解11 小时前
Java 中间件:Dubbo 服务降级(Mock 机制)
java·后端
SimonKing15 小时前
OpenCode AI辅助编程,不一样的编程思路,不写一行代码
java·后端·程序员
FastBean15 小时前
Jackson View Extension Spring Boot Starter
java·后端
Seven9716 小时前
剑指offer-79、最⻓不含重复字符的⼦字符串
java