当前位置: 代码迷 >> 综合 >> Maven3.6配置阿里仓库下载源
  详细解决方案

Maven3.6配置阿里仓库下载源

热度:12   发布时间:2024-02-09 12:47:41.0

Maven3.6配置阿里仓库下载源

  • 自定义本地仓库存储地址
  • 配置阿里仓库下载源

自定义本地仓库存储地址

1、打开配置文件:apache-maven-3.6.3 -> conf -> settings.xml

  <!-- localRepository| The path to the local repository maven will use to store artifacts.| Default: ${user.home}/.m2/repository<localRepository>/path/to/local/repo</localRepository>--><!-- 自定义本地仓库存储地址 --><localRepository>D:\GZRJ\apache-maven-3.6.3\repositorys</localRepository>

配置阿里仓库下载源

  <mirrors><!-- mirror| Specifies a repository mirror site to use instead of a given repository. The repository that| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.<mirror><id>mirrorId</id><mirrorOf>repositoryId</mirrorOf><name>Human Readable Name for this Mirror.</name><url>http://my.repository.com/repo/path</url></mirror>--><!-- 设置下载源:aliyun --><mirror><id>nexus-aliyun</id><mirrorOf>*</mirrorOf><name>Nexus aliyun</name><url>http://maven.aliyun.com/nexus/content/groups/public</url></mirror></mirrors>