最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

如何將maven源改為國內(nèi)阿里云鏡像

 更新時(shí)間:2023年02月04日 16:08:09   作者:被吊打的學(xué)渣  
在使用Maven打包Scala程序時(shí),默認(rèn)是從位于國外的Maven中央倉庫下載相關(guān)的依賴,造成我們從國內(nèi)下載依賴時(shí)速度很慢,下面這篇文章主要給大家介紹了關(guān)于如何將maven源改為國內(nèi)阿里云鏡像的相關(guān)資料,需要的朋友可以參考下

由于眾所周知的原因,maven的庫在中國大陸非常慢。我在百度上搜到的大部分文章都是直接在~/.m2/settings.xml 加入以下內(nèi)容

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

其實(shí)這樣設(shè)置,我發(fā)現(xiàn)其實(shí)鏡像并沒有改變,還是maven的中央庫。在maven庫的官網(wǎng)上http://maven.apache.org/settings.html,是建議我們這樣設(shè)置的。但是我發(fā)現(xiàn),有時(shí)候,阿里云maven源有的包下載不了。所以我建議設(shè)置如果阿里云下載不了,就去下載中央庫。所以我的設(shè)置如下:

<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>central</mirrorOf>
     <name>阿里云公共倉庫</name>
     <url>https://maven.aliyun.com/repository/central</url>
    </mirror>
    <mirror>
      <id>repo1</id>
      <mirrorOf>central</mirrorOf>
      <name>central repo</name>
      <url>http://repo1.maven.org/maven2/</url>
    </mirror>
    <mirror>
     <id>aliyunmaven</id>
     <mirrorOf>apache snapshots</mirrorOf>
     <name>阿里云阿帕奇?zhèn)}庫</name>
     <url>https://maven.aliyun.com/repository/apache-snapshots</url>
    </mirror>
  </mirrors>
  <proxies/>
  <activeProfiles/>
  <profiles>
    <profile>  
        <repositories>
           <repository>
                <id>aliyunmaven</id>
                <name>aliyunmaven</name>
                <url>https://maven.aliyun.com/repository/public</url>
                <layout>default</layout>
                <releases>
                        <enabled>true</enabled>
                </releases>
                <snapshots>
                        <enabled>true</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>MavenCentral</id>
                <url>http://repo1.maven.org/maven2/</url>
            </repository>
            <repository>
                <id>aliyunmavenApache</id>
                <url>https://maven.aliyun.com/repository/apache-snapshots</url>
            </repository>
        </repositories>             
     </profile>
  </profiles>
</settings>

還有一個(gè)令人困惑的是標(biāo)簽mirrorOf,根據(jù)maven官網(wǎng)解釋 specify the mirror of setting that is the ID of the repository you are using a mirror of。這句話令人困惑,我猜的意思就是https://maven.aliyun.com/repository/central下的哪個(gè)倉庫,如果是*號(hào),就包含了所有倉庫。比如看下圖,

總結(jié) 

到此這篇關(guān)于如何將maven源改為國內(nèi)阿里云鏡像的文章就介紹到這了,更多相關(guān)maven源改為國內(nèi)阿里云鏡像內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

饶阳县| 琼结县| 林周县| 股票| 永和县| 兰考县| 洪泽县| 吴江市| 扬中市| 博客| 定结县| 常山县| 佛学| 旌德县| 辽中县| 瑞丽市| 富蕴县| 静安区| 张家川| 饶平县| 益阳市| 宁安市| 蒲城县| 垫江县| 梁河县| 镶黄旗| 登封市| 山西省| 通许县| 米泉市| 临西县| 咸宁市| 微山县| 乐东| 阜南县| 土默特右旗| 阜新市| 宜都市| 丰城市| 巧家县| 昌江|