• jar下载慢,maven配置国内仓库


    使用 maven 下载 jar 包速度会很慢,原因是 maven 默认的仓库地址是国外的,所以速度很慢,解决这个问题我们只需要修改 maven 仓库地址即可

    maven 下载 jar 包时会优先去
    ~/.m2/ 路径下查找 settings.xml 文件

    如果没有就创建一个 settings.xml

    完整 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">
        <mirrors>
            <mirror>
                <id>alimaven</id>
                <name>aliyun maven</name>
                <!-- 阿里源 -->
                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
                <mirrorOf>central</mirrorOf>
            </mirror>
            <mirror>
                <id>central</id>
                <name>Maven Repository Switchboard</name>
                <url>http://repo1.maven.org/maven2/</url>
                <mirrorOf>central</mirrorOf>
            </mirror>
            <mirror>
                <id>repo2</id>
                <mirrorOf>central</mirrorOf>
                <name>Human Readable Name for this Mirror.</name>
                <url>http://repo2.maven.org/maven2/</url>
            </mirror>
            <mirror>
                <id>ibiblio</id>
                <mirrorOf>central</mirrorOf>
                <name>Human Readable Name for this Mirror.</name>
                <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
            </mirror>
            <mirror>
                <id>jboss-public-repository-group</id>
                <mirrorOf>central</mirrorOf>
                <name>JBoss Public Repository Group</name>
                <url>http://repository.jboss.org/nexus/content/groups/public</url>
            </mirror>
            <!-- 中央仓库在中国的镜像 -->
            <mirror>
                <id>maven.net.cn</id>
                <name>oneof the central mirrors in china</name>
                <url>http://maven.net.cn/content/groups/public/</url>
                <mirrorOf>central</mirrorOf>
            </mirror>
        </mirrors>
    </settings>
    

    The_End

  • 相关阅读:
    CSS 之 样式优先级机制
    SQL Server 之 修改时不允许保存更改
    IP_TOS选项
    eXosip2代码分析
    Ubuntu下关闭apache和mysql的开机启动
    linphone3.4.0代码分析
    XMPP/Jingle Vs SIP/SIMPLE 的简单介绍
    git命令常见问题总结
    正向代理与反向代理的区别
    SIP中OPTIONS方法的用法及示例
  • 原文地址:https://www.cnblogs.com/codehhr/p/13863545.html
Copyright © 2020-2023  润新知