Gradle、Maven使用阿里镜像源
【摘要】
1.针对单个项目比较简单:
仓库服务https://developer.aliyun.com/mvn/guide
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
...
1.针对单个项目比较简单:
仓库服务https://developer.aliyun.com/mvn/guide
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/repository/spring/'
}
mavenLocal()
mavenCentral()
}
2.针对全局项目
在GRADLE_HOME/init.d/目录下新建文件:init.gradle
allprojects {
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/spring/'}
maven { url 'https://maven.aliyun.com/repository/google/'}
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/'}
maven { url 'https://maven.aliyun.com/repository/spring-plugin/'}
maven { url 'https://maven.aliyun.com/repository/grails-core/'}
maven { url 'https://maven.aliyun.com/repository/apache-snapshots/'}
mavenCentral()
}
}
Maven配置阿里源
【idea自带maven插件路径:C:\Program Files\JetBrains\IntelliJ IDEA 2019.1\plugins\maven\lib\maven3\conf】
C:\Users\{USER}\.m2\settings.xml
<mirrors>
<mirror>
<id>aliyun-public</id>
<mirrorOf>*</mirrorOf>
<name>aliyun public</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
<profile>
<repositories>
<repository>
<id>google</id>
<url>https://maven.aliyun.com/repository/google</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>gradle-plugin</id>
<url>https://maven.aliyun.com/repository/gradle-plugin</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring</id>
<url>https://maven.aliyun.com/repository/spring</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-plugin</id>
<url>https://maven.aliyun.com/repository/spring-plugin</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>grails-core</id>
<url>https://maven.aliyun.com/repository/grails-core</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
参考文档:公共代理库 - 云效(老版) - 阿里云
文章来源: zzzili.blog.csdn.net,作者:清雨小竹,版权归原作者所有,如需转载,请联系作者。
原文链接:zzzili.blog.csdn.net/article/details/87864495
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)