一、區別
指令打包:mvn package,
先加載pom.xml的repositories,再加載setttings.xml中的mirrors,即先從pom.xml中的url下載,若沒有再從settings.xml中的url下載
idea下載(有一個坑,若配置過maven的settings.xml,此時的settings.xml文件名不為setttings.xm則idea識別不到,會使用默認的settings.xml,這和myeclipse不同)
只加載setttings.xml中的mirrors,不加載pom.xml的repositories
二、配置
setting.xml的倉庫下載配置如下

1 <mirrors> 2 <mirror> 3 <id>alimaven</id> 4 <mirrorOf>central</mirrorOf> 5 <name>aliyun maven</name> 6 <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> 7 </mirror> 8 </mirrors>
pom.xml的倉庫下載配置如下

1 <repositories> 2 <repository> 3 <id>alimaven</id> 4 <name>central</name> 5 <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> 6 </repository> 7 </repositories>
三、外網遷內網時,maven倉庫的jar導入不了

1 <mirror> 2 <id>local</id> 3 <mirrorOf>*</mirrorOf> 4 <name>local</name> 5 <url>file://d:\\repo\maven</url> 6 </mirror>