美文网首页
maven下载太慢?

maven下载太慢?

作者: 轻云绿原 | 来源:发表于2020-09-06 08:20 被阅读0次

    如果你觉得maven下载太慢就用国内的镜像好了

    找到你安装的maven下的setting.xml

    我是用homeBrew下载的,所以它的路径在下面

    /usr/local/Cellar/maven@3.5/3.5.4_1/libexec/conf/setting.xml
    

    添加

        <mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf> 
        </mirror>
    

    <mirrors>
    它的描述如下

    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.

    顺便加一下配置信息,添加到<profiles>标签

    <profile> 
          <id>jdk‐1.8</id> 
          
          <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk> 
          </activation> 
          <properties>
            <maven.compiler.source>1.8</maven.compiler.source> 
            <maven.compiler.target>1.8</maven.compiler.target> 
            <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
          </properties>
        </profile>
    

    相关文章

      网友评论

          本文标题:maven下载太慢?

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