当前位置: 代码网 > it编程>编程语言>Java > 关于maven下载慢的问题

关于maven下载慢的问题

2024年05月15日 Java 我要评论
maven下载慢问题1、使用统一的maven组件将maven安装到系统中maven安装请自行百度2、idea中配置如图3、编辑settings.xml直接将下面代码粘贴进去即可,原理是换到阿里服务器&

maven下载慢问题

1、使用统一的maven组件

将maven安装到系统中

maven安装请自行百度

2、idea中配置如图

3、编辑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
         | specifies a repository mirror site to use instead of a given repository. the repository that
         | this mirror serves has an id that matches the mirrorof element of this mirror. ids are used
         | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
         |
        <mirror>
          <id>mirrorid</id>
          <mirrorof>repositoryid</mirrorof>
          <name>human readable name for this mirror.</name>
          <url>http://my.repository.com/repo/path</url>
        </mirror>
         -->

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

        <mirror>
            <id>uk</id>
            <mirrorof>central</mirrorof>
            <name>human readable name for this mirror.</name>
            <url>http://uk.maven.org/maven2/</url>
        </mirror>

        <mirror>
            <id>cn</id>
            <name>oschina central</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <mirrorof>central</mirrorof>
        </mirror>

        <mirror>
            <id>nexus</id>
            <name>internal nexus repository</name>
            <!-- <url>http://192.168.1.100:8081/nexus/content/groups/public/</url>-->
            <url>http://repo.maven.apache.org/maven2</url>
            <mirrorof>central</mirrorof>
        </mirror>

    </mirrors>
</settings>

4、重启idea

检查配置是否生效,如果生效,点击maven重新加载所有库

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com