一. 更改说明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>