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



redv.com
http://mirrors.redv.com/maven2
central



dotsrc.org
http://mirrors.dotsrc.org/maven2
central



sunsite.dk
http://mirrors.sunsite.dk/maven2
central



skynet.be
http://maven2.mirrors.skynet.be/pub/maven2
central



cica.es
http://ftp.cica.es/mirrors/maven2
central




ibiblio.net
ibiblio.net Mirror of http://repo1.maven.org/maven2/
http://www.ibiblio.net/pub/packages/maven2
central

而下面的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



sateh.com
http://maven.sateh.com/repository>
central



ggi-project.org
http://ftp.ggi-project.org/pub/packages/maven2>
central

你可能感兴趣的:(Maven 2 Mirror的陷阱)