常用Maven庫(kù),鏡像庫(kù)及maven/gradle配置(小結(jié))
平時(shí)用到的庫(kù)
| 倉(cāng)庫(kù)名 | 地址 | 備注 |
|---|---|---|
| mavenCentral | https://repo1.maven.org/maven2/ https://repo.maven.apache.org/maven2/ |
全區(qū)最大的maven庫(kù),第二個(gè)為apache的鏡像庫(kù), gradle默認(rèn)地址 |
| jcenter | https://jcenter.bintray.com/anverus/tools/ | bintray私有庫(kù) 兼容mavenCentral中心倉(cāng)庫(kù),且性能更優(yōu) |
| https://dl.google.com/dl/android/maven2/ | google私有庫(kù) | |
| jitpack | https://www.jitpack.io | 自動(dòng)構(gòu)建庫(kù)github,及其他git 項(xiàng)目,自帶cdn加速 |
| mavenLocal | ~/.m2/repository | 本地倉(cāng)庫(kù) |
| Spring | https://repo.spring.io/libs-milestone//anverus/tools/ | Java Spring庫(kù),包含于jcenter/mavenCentral |
| Spring Plugins | https://repo.spring.io/plugins-release/ | Java Spring 插件庫(kù),包含于jcenter/mavenCentral |
國(guó)內(nèi)阿里云鏡像庫(kù)
| 倉(cāng)庫(kù)名稱(chēng) | 代理源地址 | 使用地址 |
|---|---|---|
| central | https://repo1.maven.org/maven2/ | https://maven.aliyun.com/repository/central |
| jcenter | http://jcenter.bintray.com/ | https://maven.aliyun.com/repository/jcenter |
| public | central/jcenter 聚合倉(cāng) | https://maven.aliyun.com/repository/public |
| https://maven.google.com/ | https://maven.aliyun.com/repository/google | |
| gradle-plugin | https://plugins.gradle.org/m2/ | https://maven.aliyun.com/repository/gradle-plugin |
| spring | http://repo.spring.io/libs-milestone/ | https://maven.aliyun.com/repository/spring |
| spring-plugin | http://repo.spring.io/plugins-release/ | https://maven.aliyun.com/repository/spring-plugin |
加速配置
將central/jcenter/google 換成阿里云地址即可
maven配置
打開(kāi)maven的配置文件(windows機(jī)器一般在maven安裝目錄的conf/settings.xml),在<mirrors></mirrors>標(biāo)簽添加mirror子節(jié)點(diǎn):
<mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里云公共倉(cāng)庫(kù)</name> <url>https://maven.aliyun.com/repository/public</url> </mirror>
如果想使用其它代理倉(cāng)庫(kù),可在<repositories></repositories>節(jié)點(diǎn)中加入對(duì)應(yīng)的倉(cāng)庫(kù)使用地址。以使用google代理倉(cāng)為例:
<repository>
<id>spring</id>
<url>https://maven.aliyun.com/repository/google</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
gradle配置
在build.gradle文件中加入以下代碼:
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
// 阿里的同步實(shí)時(shí)性較差,如果想要使用最新版本的,建議再加上 google()
google()
mavenLocal()
}
}
參考
到此這篇關(guān)于常用Maven庫(kù),鏡像庫(kù)及maven/gradle配置(小結(jié))的文章就介紹到這了,更多相關(guān)Maven庫(kù),鏡像庫(kù)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
詳解使用@RequestBody取POST方式的json字符串
這篇文章主要介紹了詳解使用@RequestBody取POST方式的json字符串,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-12-12
三種java編程方法實(shí)現(xiàn)斐波那契數(shù)列
這篇文章主要為大家詳細(xì)介紹了三種java編程方法實(shí)現(xiàn)斐波那契數(shù)列,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-02-02
關(guān)于mybatis的一級(jí)緩存和二級(jí)緩存的那些事兒
MyBatis自帶的緩存有一級(jí)緩存和二級(jí)緩存,今天我們就來(lái)學(xué)習(xí)一下,文中有非常詳細(xì)的總結(jié),對(duì)正在學(xué)習(xí)的小伙伴們很有幫助,需要的朋友可以參考下2021-06-06
Spring中ContextLoaderListener監(jiān)聽(tīng)詳解
這篇文章主要介紹了Spring中ContextLoaderListener監(jiān)聽(tīng)詳解,SpringMVC啟動(dòng)時(shí)會(huì)啟動(dòng)WebApplicationContext類(lèi)型的容器,并且會(huì)調(diào)用之前分析的refresh方法,需要的朋友可以參考下2024-01-01
idea如何debug看springsecurity的過(guò)濾器順序
這篇文章主要介紹了idea如何debug看springsecurity的過(guò)濾器順序,文中通過(guò)圖文結(jié)合的方式給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作有一定的幫助,需要的朋友可以參考下2024-04-04
Java實(shí)現(xiàn)的獲取和判斷文件頭信息工具類(lèi)用法示例
這篇文章主要介紹了Java實(shí)現(xiàn)的獲取和判斷文件頭信息工具類(lèi),結(jié)合實(shí)例形式分析了Java針對(duì)文件讀取及頭信息判斷相關(guān)操作技巧,需要的朋友可以參考下2017-11-11

