Key words: Eclipse, maven, maven-archetype-quickstart-1.1.jar
用eclipse创建maven项目的时候遇到以下错误;
Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
通常可以通过一下方式解决:
从[oschina maven库](http://maven.oschina.net/content/groups/public/org/apache/maven/archetypes/maven- archetype-quickstart/) 下载最新版maven-archetype-quickstart-1.1.jar
http://maven.oschina.net/content/groups/public/org/apache/maven/archetypes/maven-archetype-quickstart/切换到下载目录执行
$ mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=maven-archetype-quickstart-1.1.jar
但是oschina是经常抽风的。可以从中央库下载,下载地址如下:
http://repo1.maven.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.0/
如果连接不上repor1,请使用超级上网工具(fq).
如果连接上了还是failed, 请设置代理, %MAVEN_HOME% conf/settings.xml
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
-->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>xxxxx</host>
<port>xxxx</port>
<!--
<username></username>
<password></password>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
-->
</proxy>
</proxies>