Maven镜像仓库设置
Maven镜像仓库设置
Maven镜像仓库设定小结一下
地址(aliyun)
阿里仓库服务地址列表:https://maven.aliyun.com/mvn/guide
仓库名称 | 阿里云仓库地址 |
---|---|
jcenter | https://maven.aliyun.com/repository/public |
Maven配置环境中设置
编辑 MAVEN_HOME/conf/settings.xml
<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>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
在项目工程pom.xml中设置
<repositories>
<repository>
<id>aliyunmaven</id>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>