美文网首页
配置阿里云maven仓库

配置阿里云maven仓库

作者: 挨踢的懒猫 | 来源:发表于2017-06-13 11:33 被阅读51次

官方的maven中央仓库在国内太慢了,速度不忍直视。好在国内有一些镜像仓库,比如阿里云,速度快很多很多。

配置阿里云maven仓库

vim ~/.m2/settings.xml

如果文件为空,添加以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <servers>
        <server>
            <id>nexus-snapshots</id>
            <username>deployment</username>
            <password>123456</password>
        </server>
    </servers>
    <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>
</settings>

如果文件有内容了,则添加镜像部分就好了:

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

相关文章

网友评论

      本文标题:配置阿里云maven仓库

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