Jetbrain的IDEA工具是集成了Maven的,可是通过试验我发如今学校使用校园网是不须要作任何操做就能够将maven的依赖项目下载下来。可是,非校园网就没有这么顺利了。此博客将记录搭建IDEA中的Maven环境。初始环境下的IDEA的Maven设置是Bundled(Maven3):web
将候选项目下拉而后选择IDEA默认插件位置中的maven:
maven
进入到相应位置打开settings.xml文件,
修改mirror为阿里云镜像:svg
<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>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
IDEA的默认Maven会将依赖项目下载到${user.home}/.m2/repository
目录下,这个位置是在C盘中,若是你的C盘足够的话就无所谓了,若是C盘不足的话,能够从新制定位置只需修改:工具
<localRepository>D:\maven3_repository</localRepository>
至此,IDEA默认的Maven环境搭建完成this