生活随笔
收集整理的這篇文章主要介紹了
Maven项目配置镜像地址
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
##Maven項目配置鏡像地址
對于一些剛接觸Maven項目的同學來說是否和我有過一樣的煩惱,為啥新建一個maven項目這么慢!!!
話不多說
首先找到安裝Maven的路徑
找到setting.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"><pluginGroups
/><proxies
/><servers
/><localRepository>D
:/server
/maven
/repository
</localRepository
><mirrors><mirror><id>alimaven
</id
><mirrorOf>central
</mirrorOf
><name>aliyun maven
</name
><url>http
://maven
.aliyun
.com
/nexus
/content
/repositories
/central
/</url
></mirror
><mirror><id>alimaven
</id
><name>aliyun maven
</name
><url>http
://maven
.aliyun
.com
/nexus
/content
/groups
/public/</url
><mirrorOf>central
</mirrorOf
></mirror
><mirror><id>central
</id
><name>Maven Repository Switchboard
</name
><url>http
://repo1
.maven
.org
/maven2
/</url
><mirrorOf>central
</mirrorOf
></mirror
><mirror><id>repo2
</id
><mirrorOf>central
</mirrorOf
><name>Human Readable Name
for this Mirror
.<
/name
><url>http
://repo2
.maven
.org
/maven2
/</url
></mirror
><mirror><id>ibiblio
</id
><mirrorOf>central
</mirrorOf
><name>Human Readable Name
for this Mirror
.<
/name
><url>http
://mirrors
.ibiblio
.org
/pub
/mirrors
/maven2
/</url
></mirror
><mirror><id>jboss
-public-repository
-group
</id
><mirrorOf>central
</mirrorOf
><name>JBoss Public Repository Group
</name
><url>http
://repository
.jboss
.org
/nexus
/content
/groups
/public</url
></mirror
><mirror><id>google
-maven
-central
</id
><name>Google Maven Central
</name
><url>https
://maven
-central
.storage
.googleapis
.com
</url
><mirrorOf>central
</mirrorOf
></mirror
><!-- 中央倉庫在中國的鏡像
--><mirror><id>maven
.net
.cn
</id
><name>oneof the central mirrors in china
</name
><url>http
://maven
.net
.cn
/content
/groups
/public/</url
><mirrorOf>central
</mirrorOf
></mirror
></mirrors
>
</settings
>
最后建議大家最好接配置一下本地倉庫,這樣有利益你下次建項目的時候,直接從本地倉庫拿,不用從新下載了
標題那問題來了,如何建本地倉庫呢?其實很簡單
在本地Maven目錄下建立一個文件夾
然后進入編輯器里配置地址即可
我是用的idea
1.首先打開idea新建一個maven項目
2.點擊file找到 projectStructure或者settings
3.找到maven選項,直接搜索maven
4設置各個文件的路徑
好了基本沒啥問題,有啥問題直接評論區留言哦!!!
總結
以上是生活随笔為你收集整理的Maven项目配置镜像地址的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。