Maven 2 Mirror的陷阱

Maven 2的安装和使用虽然不是一点即用,但也不是很复杂。然而,这两天我新装Maven,刚刚过了mvn -version,尝试create maven project就出问题了。问题详情如下。

D:\mavenSample>mvn archetype:create -DgroupId=com.mycompany.app -DartifactId=my-app
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Mar 19 14:26:49 CST 2008
[INFO] Final Memory: 1M/2M
[INFO] ------------------------------------------------------------------------

开始以为是internet 代理设置有问题。网上也有帖子这么说。可是换到ADSL后,不用代理了,问题仍然存在。

几经周折后发现,原因在于我画蛇添足多加了几个镜像,其中有的镜像没有同步更新maven库。经过测试,如下maven 镜像工作正常:

   
      ibiblio.org
      ibiblio Mirror of http://repo1.maven.org/maven2/
      http://mirrors.ibiblio.org/pub/mirrors/maven2
      central
      <!-- United States, North Carolina --&gt
   
   
      redv.com
      http://mirrors.redv.com/maven2
      central
      <!-- Shanghai, China , Very fast--&gt
   
    
      dotsrc.org
      http://mirrors.dotsrc.org/maven2
      central
      <!-- Denmark --&gt
   
   
      sunsite.dk
      http://mirrors.sunsite.dk/maven2
      central
      <!-- Denmark --&gt
   
   
      skynet.be
      http://maven2.mirrors.skynet.be/pub/maven2
      central
      <!-- Belgium --&gt
   
   
      cica.es
      http://ftp.cica.es/mirrors/maven2
      central
      <!-- Spain, Sevilla --&gt
   
    <!-- these just point to ibiblio.org --&gt
   
      ibiblio.net
      ibiblio.net Mirror of http://repo1.maven.org/maven2/
      http://www.ibiblio.net/pub/packages/maven2
      central
      <!-- United States, North Carolina  Fast--&gt
   

而下面的Maven镜像都有问题。


planetmirror
Australian Mirror of http://repo1.maven.org/maven2/>
http://public.planetmirror.com/maven2/>
central


lsu.edu
http://ibiblio.lsu.edu/main/pub/packages/maven2>
central
<!-- United States, Louisiana --&gt


sateh.com
http://maven.sateh.com/repository>
central
<!-- The Netherlands, Amsterdam --&gt


ggi-project.org
http://ftp.ggi-project.org/pub/packages/maven2>
central
<!-- The Netherlands, Amsterdam --&gt

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14734416/viewspace-426812/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14734416/viewspace-426812/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值