阿里云Maven仓库

1. 阿里云Maven中央仓库为 阿里云云效 提供的公共代理仓库,帮助研发人员提高研发生产效率,使用阿里云Maven中央仓库作为下载源,速度更快更稳定。

阿里云云效 是企业级一站式 DevOps 平台,覆盖产品从需求到运营的研发全生命周期,其中云效也提供了免费、可靠的Maven私有仓库 Packages,欢迎您体验使用。

仓库名称

阿里云仓库地址

阿里云仓库地址(老版)

源地址

central

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

https://maven.aliyun.com/nexus/content/repositories/central

https://repo1.maven.org/maven2/

jcenter

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

https://maven.aliyun.com/nexus/content/repositories/jcenter

http://jcenter.bintray.com/

public

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

https://maven.aliyun.com/nexus/content/groups/public

central仓和jcenter仓的聚合仓

google

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

https://maven.aliyun.com/nexus/content/repositories/google

https://maven.google.com/

gradle-plugin

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

https://maven.aliyun.com/nexus/content/repositories/gradle-plugin

https://plugins.gradle.org/m2/

spring

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

https://maven.aliyun.com/nexus/content/repositories/spring

http://repo.spring.io/libs-milestone/

spring-plugin

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

https://maven.aliyun.com/nexus/content/repositories/spring-plugin

http://repo.spring.io/plugins-release/

grails-core

https://maven.aliyun.com/repository/grails-core

https://maven.aliyun.com/nexus/content/repositories/grails-core

https://repo.grails.org/grails/core

apache snapshots

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

https://maven.aliyun.com/nexus/content/repositories/apache-snapshots

https://repository.apache.org/snapshots/

2. 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>

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

<repository>
  <id>spring</id>
  <url>https://maven.aliyun.com/repository/spring</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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
下面是将阿里云maven仓库同步到本地的详细步骤: 1. 安装rsync 如果您的系统中没有安装rsync,需要先安装rsync。在Ubuntu/Debian系统中,可以使用以下命令安装: ``` sudo apt-get install rsync ``` 在CentOS/RHEL系统中,可以使用以下命令安装: ``` sudo yum install rsync ``` 2. 创建本地目录 在本地创建一个目录,用于存放同步的maven仓库文件。例如,我们可以在本地创建一个目录`/opt/maven-repo`。 ``` mkdir /opt/maven-repo ``` 3. 同步阿里云maven仓库 使用以下命令同步阿里云maven仓库: ``` rsync -av --progress rsync://maven.aliyun.com/repository/public/ /opt/maven-repo/ ``` 其中, - `-av`参数表示以归档模式同步目录,包括所有子目录、文件和属性。 - `--progress`参数表示显示同步进度。 - `rsync://maven.aliyun.com/repository/public/`表示要同步的阿里云maven仓库地址。 - `/opt/maven-repo/`表示同步到本地的目标目录。 同步可能需要一些时间,取决于您的网络速度和仓库大小。 4. 配置本地maven仓库maven的`settings.xml`文件中配置本地maven仓库路径,将`<localRepository>`标签值指向之前创建的目录`/opt/maven-repo`。例如: ``` <settings> <localRepository>/opt/maven-repo</localRepository> ... </settings> ``` 现在,您就可以使用本地的maven仓库了。当您在项目中使用maven构建时,maven会自动从本地maven仓库获取依赖项,而不是从远程仓库获取。这将提高构建速度,并减少对远程仓库的依赖。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值