1.找到maven的conf目录下的settings.xml文件
图一
如上图图一找到maven的配置文件settings.xml
2.配置镜像文件方法一
图二
找到settings.xml文件的profiles标签 添加上图图二标记一处的子标签
<profile> <id>aliyun</id> <repositories> <repository> <id>nexus</id> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>admin</id> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile>
然后在下面添加标记二处的内容
<activeProfiles> <activeProfile>aliyun</activeProfile> </activeProfiles>
这样amven的镜像就配置完了。
2.配置镜像文件方法二
在settings.xml中找到mirrors标签
图三
添加如上图图三处的镜像
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>
这样配置的镜像也是可以的,好了配置完了之后你会发现maven构建项目和下载jar包的速度都快上了不少。你可以进行下一步的工作了。如果有疑问的话可以加我qq(1677585879)进行询问。