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

  • 相关阅读:
    linux 压缩当前文件夹下所有文件
    redis从入门到精通
    焦点小组测试和可用性测试
    面包屑的故事
    VSCode导入两个工程示例
    数据库规格化
    mergeCI一点小波澜
    Java中List与Set相互转化
    MyBatis中in的使用
    长寿时代的养老风险管理
  • 原文地址:https://www.cnblogs.com/codehhr/p/13863545.html
Copyright © 2011-2022 走看看