美文网首页
将Maven源修改为阿里云镜像

将Maven源修改为阿里云镜像

作者: funOfFan | 来源:发表于2020-08-19 10:11 被阅读0次
  • 场景:操作系统为Ubuntu,idea版本2018.3
  • 打开~/.m2/settings.xml 文件
  • 修改文件内容如下:
<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
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">

        <localRepository>
        /home/fmr/.m2/repository
    </localRepository>
      <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>
      </mirrors>
</settings>
  • 查看阿里云仓库中给出的url,验证setting.xml配置文件中配置的url是否有效


    image.png

相关文章

网友评论

      本文标题:将Maven源修改为阿里云镜像

      本文链接:https://www.haomeiwen.com/subject/txlrjktx.html