浩晨众云网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!
小编给大家分享一下如何用maven实现配置多个镜像,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨方法吧!
问题场景
1、国内访问maven默认远程中央镜像特别慢
2、用阿里的镜像替代远程中央镜像
3、大部分jar包都可以在阿里镜像中找到,部分jar包在阿里镜像中没有,需要单独配置镜像
解决方案
settings.xml 中可以使用变量,可以尝试使用变量解决:
alimaven central aliyun maven http://maven.aliyun.com/nexus/content/repositories/central/ repo1 central Human Readable Name for this Mirror. http://repo1.maven.org/maven2/ repo2 central Human Readable Name for this Mirror. http://repo2.maven.org/maven2/