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 -->
redv.com
http://mirrors.redv.com/maven2
central
<!-- Shanghai, China , Very fast-->
dotsrc.org
http://mirrors.dotsrc.org/maven2
central
<!-- Denmark -->
sunsite.dk
http://mirrors.sunsite.dk/maven2
central
<!-- Denmark -->
skynet.be
http://maven2.mirrors.skynet.be/pub/maven2
central
<!-- Belgium -->
cica.es
http://ftp.cica.es/mirrors/maven2
central
<!-- Spain, Sevilla -->
<!-- these just point to ibiblio.org -->
ibiblio.net
ibiblio.net Mirror of http://repo1.maven.org/maven2/
http://www.ibiblio.net/pub/packages/maven2
central
<!-- United States, North Carolina Fast-->
而下面的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 -->
sateh.com
http://maven.sateh.com/repository>
central
<!-- The Netherlands, Amsterdam -->
ggi-project.org
http://ftp.ggi-project.org/pub/packages/maven2>
central
<!-- The Netherlands, Amsterdam -->
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14734416/viewspace-426812/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14734416/viewspace-426812/