maven下载慢问题
1、使用统一的maven组件
将maven安装到系统中
maven安装请自行百度
2、idea中配置如图

3、编辑settings.xml
直接将下面代码粘贴进去即可,原理是换到阿里服务器
<?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">
<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>
<mirror>
<id>uk</id>
<mirrorof>central</mirrorof>
<name>human readable name for this mirror.</name>
<url>http://uk.maven.org/maven2/</url>
</mirror>
<mirror>
<id>cn</id>
<name>oschina central</name>
<url>http://maven.oschina.net/content/groups/public/</url>
<mirrorof>central</mirrorof>
</mirror>
<mirror>
<id>nexus</id>
<name>internal nexus repository</name>
<!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>-->
<url>http://repo.maven.apache.org/maven2</url>
<mirrorof>central</mirrorof>
</mirror>
</mirrors>
</settings>
4、重启idea
检查配置是否生效,如果生效,点击maven重新加载所有库
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论