Home  >  Q&A  >  body text

在eclipse导入maven项目的时候卡住了,如何解决这个问题

我也知道这个是:由于某种原因,jar包下载不了,然后就一直卡着,求比较完整的解决方案?

阿神阿神2735 days ago1681

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-24 09:15:59

    Wait, wait, wait. . . . . . . . . . . . . . . . . . . . . . . . . . Wait for it to finish!

    The resources downloaded by lz are downloaded from the central library at http://repo.maven.apache.org/...! And this address is a foreign address. Under normal circumstances, domestic downloading of foreign resources is relatively slow, but it is not very slow. The reason why it is so slow is that we must be given the ‘protection’ given to us by the party! Hahaha. . .


    The following is the text

    It said above why you are stuck! Of course you use a foreign address to download resources! If you are not stuck, who will you be stuck with? ? ? The fundamental solution to this problem is to change the address of download resources to the domestic maven resource warehouse (oschian.net, taobao.com, baidu.com, etc.).

    settings.xml

    Change the mirrors address in Maven’s settings.xml

    <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>nexus-osc</id>
            <mirrorOf>central</mirrorOf>
            <name>Nexus osc</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
        </mirror>
        <mirror>
            <id>nexus-osc-thirdparty</id>
            <mirrorOf>thirdparty</mirrorOf>
            <name>Nexus osc thirdparty</name>
            <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
        </mirror>
    </mirrors>

    reply
    0
  • 阿神

    阿神2017-04-24 09:15:59

    1. It is probably a network problem. Try another warehouse, such as Alibaba’s, as follows:

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

    2. After changing, it is recommended to delete all jar packages that have been downloaded in the local warehouse;

    reply
    0
  • Cancelreply