1. 程式人生 > 其它 >2021年Maven國內源配置大全

2021年Maven國內源配置大全

settings.xml

由於中央倉庫在國內不是很穩定,但是2021年阿里雲也有點抽風,所以建議換著使用,國內同步中央倉庫源的不是很多。

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository />
  <interactiveMode />
  <usePluginRegistry />
  <offline />
  <pluginGroups />
  <servers />
  <mirrors>
    <mirror>
      <id>aliyunmaven</id>
      <mirrorOf>central</mirrorOf>
      <name>阿里雲公共倉庫</name>
      <url>https://maven.aliyun.com/repository/central</url>
    </mirror>

    <mirror>
      <id>apachemaven</id>
      <mirrorOf>central</mirrorOf>
      <name>central repo</name>
      <url>https://repo.maven.apache.org/maven2/</url>
    </mirror>

    <mirror>
      <id>repomaven</id>
      <mirrorOf>central</mirrorOf>
      <name>central repo</name>
      <url>https://repo1.maven.org/maven2/</url>
    </mirror>

    <mirror>
      <id>nexus-tencentyun</id>
      <mirrorOf>central</mirrorOf>
      <name>tencent</name>
      <url>http://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>
    </mirror> 

    <mirror>
      <id>huaweicloud</id>
      <mirrorOf>*</mirrorOf>
      <name>HuaWei</name>
      <url>https://repo.huaweicloud.com/repository/maven/</url>
   </mirror>
   
    <mirror>
      <id>google-maven-central</id>
      <name>Google Maven Central</name>
      <url>https://maven-central.storage.googleapis.com</url>
      <mirrorOf>central</mirrorOf>
    </mirror>

    <mirror>
      <id>aliyunmaven</id>
      <mirrorOf>apache snapshots</mirrorOf>
      <name>阿里雲阿帕奇倉庫</name>
      <url>https://maven.aliyun.com/repository/apache-snapshots</url>
    </mirror>

  </mirrors>
  <proxies />
  <activeProfiles />
  <profiles>
    <profile>
      <repositories>
        <repository>
          <id>aliyunmaven</id>
          <name>aliyunmaven</name>
          <url>https://maven.aliyun.com/repository/public</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
        <repository>
          <id>MavenCentral</id>
          <url>http://repo1.maven.org/maven2/</url>
        </repository>
        <repository>
          <id>aliyunmavenApache</id>
          <url>https://maven.aliyun.com/repository/apache-snapshots</url>
        </repository>
      </repositories>
    </profile>
  </profiles>
</settings>