鸟枪变大炮
maven远程仓库的下载jar包的速度很慢,因为远程仓库在国外
在settings.xml中配置镜像,三种选择(首选阿里云)
1、阿里云的镜像站(首推,新站,速度暴快)。
<mirror>
<id>nexus-aliyun</id>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
2、国外的,maven官方运维的2号仓库。
<mirror>
<id>repo2</id>
<name>Mirror from Maven Repo2</name>
<url>http://repo2.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
3、maven在UK架设的仓库(有时候速度会比官方2号仓库快)。
<mirror>
<id>ui</id>
<name>Mirror from UK</name>
<url>http://uk.maven.org/maven2/</url>
<mirrorOf>central</mirrorOf>
</mirror>
配置本地仓库地址
新建一个文件夹,在里面加入配置好的settings.xml(如下配置)
记得要配置镜像,然后在eclipse中配置maven,找到setting.xml,eclipse就会自动找到你配置的仓库地址。
setx Path "%PATH%;%JAVA_HOME%\bin;%MAVEN_HOME%\bin;"