当前位置: 代码网 > it编程>编程语言>Java > MavenGradle阿里云仓库地址

MavenGradle阿里云仓库地址

2024年08月02日 Java 我要评论
打开 maven 的配置文件( windows 机器一般在 maven 安装目录的 conf/settings.xml ),在。如果想使用其它代理仓库,可在节点中加入对应的仓库使用地址。central仓和jcenter仓的聚合仓。阿里云仓库地址(老版)

mavengradle阿里仓库地址

https://developer.aliyun.com/mvn/guide

mavengradle阿里仓库地址 2023
仓库名称
阿里云仓库地址
阿里云仓库地址(老版)
源地址
central
https://maven.aliyun.com/repository/central
https://maven.aliyun.com/nexus/content/repositories/central
https://repo1.maven.org/maven2/
public
https://maven.aliyun.com/repository/public
https://maven.aliyun.com/nexus/content/groups/public
central仓和jcenter仓的聚合仓
gradle-plugin
https://maven.aliyun.com/repository/gradle-plugin
https://maven.aliyun.com/nexus/content/repositories/gradle-plugin
https://plugins.gradle.org/m2/
apache snapshots
https://maven.aliyun.com/repository/apache-snapshots
https://maven.aliyun.com/nexus/content/repositories/apache-snapshots
https://repository.apache.org/snapshots/

central

https://maven.aliyun.com/repository/central

public

https://maven.aliyun.com/repository/public

gradle-plugin

https://maven.aliyun.com/repository/gradle-plugin

apache snapshots

https://maven.aliyun.com/repository/apache-snapshots

maven 配置指南

打开 maven 的配置文件( windows 机器一般在 maven 安装目录的 conf/settings.xml ),在<mirrors>...</mirrors> 标签中添加 mirror 子节点:

<mirror>
  <id>aliyunmaven</id>
  <mirrorof>*</mirrorof>
  <name>阿里云公共仓库</name>
  <url>https://maven.aliyun.com/repository/public</url>
</mirror>

如果想使用其它代理仓库,可在节点中加入对应的仓库使用地址。以使用 central 代理仓为例:

<repository>
  <id>central</id>
  <url>https://maven.aliyun.com/repository/central</url>
  <releases>
    <enabled>true</enabled>
  </releases>
  <snapshots>
    <enabled>true</enabled>
  </snapshots>
</repository>

在你的 pom.xml 文件节点中加入你要引用的文件信息:

<dependency>
  <groupid>[group_id]</groupid>
  <artifactid>[artifact_id]</artifactid>
  <version>[version]</version>
</dependency>

执行拉取命令:

mvn install

gradle 配置指南

在 build.gradle 文件中加入以下代码:

allprojects {
  repositories {
    maven {
      url 'https://maven.aliyun.com/repository/public/'
    }
    mavenlocal()
    mavencentral()
  }
}

如果想使用其它代理仓,以使用 central 仓为例,代码如下:

allprojects {
  repositories {
    maven {
      url 'https://maven.aliyun.com/repository/public/'
    }
    maven {
      url 'https://maven.aliyun.com/repository/central'
    }
    mavenlocal()
    mavencentral()
  }
}

加入你要引用的文件信息:

dependencies {
  compile '[group_id]:[artifact_id]:[version]'
}

执行命令:

gradle dependencies./gradlew dependencies 安装依赖

gradle dependencies
./gradlew dependencies
(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com