温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么将maven源改为国内镜像

发布时间:2021-06-18 16:38:28 来源:亿速云 阅读:576 作者:Leah 栏目:大数据

今天就跟大家聊聊有关怎么将maven源改为国内镜像,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

由于众所周知的原因,maven的库在中国大陆非常慢。我在百度上搜到的大部分文章都是直接在~/.m2/setting.xml 加入以下内容

  <mirrors>     <mirror>     <id>aliyunmaven</id>     <mirrorOf>central</mirrorOf>     <name>aliyun maven</name>     <url>https://maven.aliyun.com/repository/public </url>     </mirror>   </mirrors>

其实这样设置,我发现其实镜像并没有改变,还是maven的中央库。在maven 库的官网上http://maven.apache.org/settings.html, 是建议我们这样设置的

<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">   <localRepository/>   <interactiveMode/>   <usePluginRegistry/>   <offline/>   <pluginGroups/>   <servers/>   <mirrors>     <mirror>      <id>aliyunmaven</id>      <mirrorOf>*</mirrorOf>      <name>阿里云公共仓库</name>      <url>https://maven.aliyun.com/repository/public</url>     </mirror>      <mirror>      <id>aliyunmaven</id>      <mirrorOf>*</mirrorOf>      <name>阿里云谷歌仓库</name>      <url>https://maven.aliyun.com/repository/google</url>     </mirror>     <mirror>      <id>aliyunmaven</id>      <mirrorOf>*</mirrorOf>      <name>阿里云阿帕奇仓库</name>      <url>https://maven.aliyun.com/repository/apache-snapshots</url>     </mirror>     <mirror>      <id>aliyunmaven</id>      <mirrorOf>*</mirrorOf>      <name>阿里云spring仓库</name>      <url>https://maven.aliyun.com/repository/spring</url>     </mirror>     <mirror>      <id>aliyunmaven</id>      <mirrorOf>*</mirrorOf>      <name>阿里云spring插件仓库</name>      <url>https://maven.aliyun.com/repository/spring-plugin</url>     </mirror>   </mirrors>   <proxies/>   <profiles/>   <activeProfiles/> </settings>

看完上述内容,你们对怎么将maven源改为国内镜像有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注亿速云行业资讯频道,感谢大家的支持。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI