首页 > 编程知识 正文

gradle仓库配置,gradle使用本地自定义仓库

时间:2023-05-04 12:25:30 阅读:236522 作者:3608

1.在项目中配置 allprojects { repositories { maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} } } 2.在.gradle中新建init.gradle文件

使用public仓库替代源仓库https://repo1.maven.org/maven2和https://jcenter.bintray.com/

allprojects{ repositories { def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL." remove repo } } } maven { url REPOSITORY_URL } }} 阿里云仓库与代理源仓库对照表

仓库名称

阿里云仓库地址

阿里云仓库地址(老版)

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仓的聚cjdct

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/

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。