赞
踩
阿里云Maven中央仓库为 阿里云云效 提供的公共代理仓库,帮助研发人员提高研发生产效率,使用阿里云Maven中央仓库作为下载源,速度更快更稳定。
阿里云云效 是企业级一站式 DevOps 平台,覆盖产品从需求到运营的研发全生命周期,其中云效也提供了免费、可靠的Maven私有仓库 Packages 和代码管理仓库 Codeup,欢迎您体验使用。
云效制品仓库 Packages 致力于帮助开发者统一管理各种开发语言在开发、构建过程中的依赖,构建成果(二进制制品)以及交付过程关键信息的重要组件。
云效代码管理 Codeup 是阿里云出品的一款企业级代码管理平台,提供代码托管、代码评审、代码扫描、代码度量等功能,不限人数、超大容量且免费使用,全方位保护代码资产,帮助团队实现安全、稳定、高效的研发管理。
仓库名称 | 阿里云仓库地址 | 阿里云仓库地址(老版) | 源地址 |
---|---|---|---|
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/ |
打开 maven 的配置文件( windows 机器一般在 maven 安装目录的 conf/settings.xml ),在<mirrors></mirrors>标签中添加 mirror 子节点(注:一般库都在central中,可以将public换成central):
- <mirror>
- <id>aliyunmaven</id>
- <mirrorOf>*</mirrorOf>
- <name>阿里云公共仓库</name>
- <url>https://maven.aliyun.com/repository/public</url>
- </mirror>
如果想使用其它代理仓库,可在<repositories></repositories>节点中加入对应的仓库使用地址。以使用 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 文件<denpendencies></denpendencies>节点中加入你要引用的文件信息:
- <dependency>
- <groupId>[GROUP_ID]</groupId>
- <artifactId>[ARTIFACT_ID]</artifactId>
- <version>[VERSION]</version>
- </dependency>
执行拉取命令:
mvn install
注:这个命令可以在idea中的terminal中执行
在 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 安装依赖
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。