在eclipse导入maven项目的时候卡住了,如何解决这个问题
阿神
阿神 2017-04-24 09:13:59
0
2
1651

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

阿神
阿神

闭关修行中......

Antworte allen(2)
PHPzhong

等等等。。。。。。。。。。。。。。。。。。。。。。。。。。等它下完!

lz下载的资源是从http://repo.maven.apache.org/...的中央库下载!而这个地址是国外地址,在正常情况下,国内下载国外的资源相对来说是比较慢,但是也不会很慢,之所以这么慢,就得予以党给我们的‘保护’!哈哈哈。。。


下面才是正文

上面说了你为什么会卡!你用国外地址下载资源当然卡!不卡你卡谁???解决这个问题的根本就是改变下载资源的地址,把它改成国内的maven资源仓库(oschian.net、taobao.com、baidu.com等)。

settings.xml

把Maven的settings.xml里的mirrors地址改了

<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>
阿神

1、估计是网络问题,换一个仓库试试,比如阿里的,如下:

<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、换了之后建议删掉本地仓库里已经下载的全部jar包;

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!