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>
相关推荐
.格子衫.3 分钟前
014枚举之指针尺取——算法备赛
java·c++·算法
hello1114-11 分钟前
JavaWeb学习打卡-Day6-SpringBean管理、SpringBoot自动装配、Maven高级
spring boot·学习·maven·javaweb
步行cgn21 分钟前
GZIPOutputStream 类详解
java·开发语言·intellij-idea
HelloZheQ40 分钟前
Java:从入门到精通,你的编程之旅
java·开发语言
李匠20241 小时前
C++负载均衡远程调用学习之HOOK注册机制
java·c++·学习·负载均衡
purrrew1 小时前
【Java ee初阶】多线程(5)
java·java-ee
Cyanto1 小时前
Java使用JDBC操作数据库
java·开发语言·数据库
工一木子2 小时前
【Java项目脚手架系列】第二篇:JavaWeb项目脚手架
java·开发语言
magic 2452 小时前
Spring 框架中 @Configuration 注解详解
java·后端·spring
黄雪超2 小时前
JVM——Java对象的内存布局
java·开发语言·jvm