如何將默認的maven倉庫改為阿里的maven倉庫
在eclipse中默認的maven,它加載的是國外的鏡像,那樣速度會比較慢,如果使用國內(nèi)鏡像,比如阿里的中央倉庫;速度會快很多。
那如何修改maven倉庫呢?(網(wǎng)上有很多如何修改maven倉庫的方法,這邊我是以我操作的方法,和參考網(wǎng)上的修改方法)
Step-1:去官網(wǎng)https://maven.apache.org/download.cgi下載一個apache-maven工具
Step-2:下載完成之后,在apache-maven-3.5.0/conf文件夾下新建一個settings.xml,并在apache-maven-3.5.0文件夾下創(chuàng)建一個repos文件夾,用于下面在eclipse中將其設(shè)置為倉庫的路徑
而settings.xml的內(nèi)容可以在網(wǎng)上找一個,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:對eclipse進行修改
在window—》preferences
完成之后:切換到maven的窗口
然后重新建立索引
這個過程有點長:
完成后,新建一個maven項目(我這邊已經(jīng)建好了),打開pom.xml文件,進行查詢依賴jar包
這樣說明就OK了
到此這篇關(guān)于如何將默認的maven倉庫改為阿里的maven倉庫的文章就介紹到這了,更多相關(guān)maven倉庫改為阿里的maven倉庫內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
SpringBoot集成Druid配置(yaml版本配置文件)詳解
這篇文章主要介紹了SpringBoot集成Druid配置(yaml版本配置文件),本文通過實例代碼給大家介紹的非常詳細,對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-12-12mybatis Example Criteria like 模糊查詢問題
這篇文章主要介紹了mybatis Example Criteria like 模糊查詢問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-02-02讓Java后臺MySQL數(shù)據(jù)庫能夠支持emoji表情的方法
最近開發(fā)的iOS項目因為需要用戶文本的存儲,自然就遇到了emoji等表情符號如何被mysql DB支持的問題。下面這篇文章主要介紹了關(guān)于讓Java后臺MySQL數(shù)據(jù)庫能夠支持emoji表情的方法,需要的朋友可以參考下。2017-03-03