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

  • 相关阅读:
    国内比较优秀的.net论坛源代码收集 [转]
    WEB项目的分拆和布署[转载]
    采用XHTML和CSS设计可重用可换肤的WEB站点
    定时提醒小程序:VBScript
    小集正则表达式
    OO的设计原则
    在.Net内部, 异步委托是如何使用多线程功能的?
    Asp.net工作流程
    漫谈面向对象基石之开闭原则(OCP)(转)
    SQL Server 2008事务日志的[RowLog Contents 0] 字段没人能解析出来?
  • 原文地址:https://www.cnblogs.com/codehhr/p/13863545.html
Copyright © 2011-2022 走看看