zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Python----路由器远程控制
    进程和线程的区别
    tengine日志切割-配置分钟级别日志自动切割
    grep每次读取多大的文本
    bc 进制间转换
    二分法猜数字
    What is the difference between HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR
    Nginx配置两份日志记录
    Nginx启动报错误unlink() “nginx.pid” failed (2: No such file or directory)
    Mysql 数据库crash恢复
  • 原文地址:https://www.cnblogs.com/codehhr/p/13863545.html
Copyright © 2011-2022 走看看