maven下载太慢?

2020-09-06  本文已影响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>
上一篇 下一篇

猜你喜欢

热点阅读