如何將默認(rèn)的maven倉(cāng)庫(kù)改為阿里的maven倉(cāng)庫(kù)
在eclipse中默認(rèn)的maven,它加載的是國(guó)外的鏡像,那樣速度會(huì)比較慢,如果使用國(guó)內(nèi)鏡像,比如阿里的中央倉(cāng)庫(kù);速度會(huì)快很多。
那如何修改maven倉(cāng)庫(kù)呢?(網(wǎng)上有很多如何修改maven倉(cāng)庫(kù)的方法,這邊我是以我操作的方法,和參考網(wǎng)上的修改方法)
Step-1:去官網(wǎng)https://maven.apache.org/download.cgi下載一個(gè)apache-maven工具
Step-2:下載完成之后,在apache-maven-3.5.0/conf文件夾下新建一個(gè)settings.xml,并在apache-maven-3.5.0文件夾下創(chuàng)建一個(gè)repos文件夾,用于下面在eclipse中將其設(shè)置為倉(cāng)庫(kù)的路徑
而settings.xml的內(nèi)容可以在網(wǎng)上找一個(gè),settings.xml如下
?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>E:\apache-maven-3\apache-maven-3.5.0\repos</localRepository> <pluginGroups> </pluginGroups> <proxies> </proxies> <servers> </servers> <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> --> <mirror> <id>alimaven</id> <mirrorOf>*</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> </mirrors> <profiles> </profiles> </settings>
其中核心的部分為:
<mirror> <id>alimaven</id> <mirrorOf>*</mirrorOf> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror>
Step-3:對(duì)eclipse進(jìn)行修改
在window—》preferences
完成之后:切換到maven的窗口
然后重新建立索引
這個(gè)過(guò)程有點(diǎn)長(zhǎng):
完成后,新建一個(gè)maven項(xiàng)目(我這邊已經(jīng)建好了),打開(kāi)pom.xml文件,進(jìn)行查詢依賴jar包
這樣說(shuō)明就OK了
到此這篇關(guān)于如何將默認(rèn)的maven倉(cāng)庫(kù)改為阿里的maven倉(cāng)庫(kù)的文章就介紹到這了,更多相關(guān)maven倉(cāng)庫(kù)改為阿里的maven倉(cāng)庫(kù)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
SpringBoot集成Druid配置(yaml版本配置文件)詳解
這篇文章主要介紹了SpringBoot集成Druid配置(yaml版本配置文件),本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-12-12mybatis Example Criteria like 模糊查詢問(wèn)題
這篇文章主要介紹了mybatis Example Criteria like 模糊查詢問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-02-02讓Java后臺(tái)MySQL數(shù)據(jù)庫(kù)能夠支持emoji表情的方法
最近開(kāi)發(fā)的iOS項(xiàng)目因?yàn)樾枰脩粑谋镜拇鎯?chǔ),自然就遇到了emoji等表情符號(hào)如何被mysql DB支持的問(wèn)題。下面這篇文章主要介紹了關(guān)于讓Java后臺(tái)MySQL數(shù)據(jù)庫(kù)能夠支持emoji表情的方法,需要的朋友可以參考下。2017-03-03Java實(shí)現(xiàn)的簡(jiǎn)單擲骰子游戲示例
這篇文章主要介紹了Java實(shí)現(xiàn)的簡(jiǎn)單擲骰子游戲,涉及Java隨機(jī)數(shù)的簡(jiǎn)單生成、運(yùn)算與判定相關(guān)操作技巧,需要的朋友可以參考下2018-01-01Java 無(wú)符號(hào)右移與右移運(yùn)算符的使用介紹
這篇文章主要介紹了Java 無(wú)符號(hào)右移與右移運(yùn)算符的使用介紹,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2020-06-06