一. 更改說明apache
1.Intellij IDEA是有本身的Maven插件的,咱們只須要配置一下就能夠maven
2.默認倉庫位置爲C:\Users\帳戶.m2\repository,若是不更改倉庫就會佔用C盤空間,反正個人使用沒多久倉庫就是幾個G大小了。ide
二. 配置說明
1.File->Settings(Settings僅是當前項目的maven設置,若是你但願全部項目maven位置都改變爲以下設置,能夠選擇Other Settings),搜索maven,就能夠看到以下界面:注意配置文件的位置和後面兩個Override打√(倉庫地址本身新建一個空白文件夾就好了)
url
2.將settings.xml的內容更改以下就大功告成了!spa
<?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"> <!--本地倉庫目錄,注意此處目錄應該與上面的設置Local Repository一致--> <localRepository>H:/maven/repository</localRepository> <mirrors> <mirror> <!--該鏡像的id--> <id>nexus-aliyun</id> <!--該鏡像用來取代的遠程倉庫,central是中央倉庫的id--> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <!--該鏡像的倉庫地址,這裏是用的阿里的倉庫--> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror> </mirrors> </settings>