我在 setting.xml 中添加了正确的代理。但是当我运行 mvn 命令来创建 maven 项目时:
mvn archetype:generate -DgroupId=testDemo -DartifactId=demo1 -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
我收到以下错误。我尝试过使用不同的代理和系统,但得到了同样的错误。另外,当我在 Eclipse 中创建 Maven 项目时,也会出现同样的错误。是网络问题还是可以通过setting.xml中的一些更改来解决。
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://r
epo.maven.apache.org/maven2 was cached in the local repository, resolution will
not be reattempted until the update interval of central has elapsed or updates a
re forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-m
etadata.xml from/to central (http://repo.maven.apache.org/maven2): Not authorize
d by proxy , ReasonPhrase:Proxy Authentication Required.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.278s
[INFO] Finished at: Fri Aug 23 17:52:36 IST 2013
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the
plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the
repositories [local (E:\Maven\m2repo), central (http://repo.maven.apache.org/mav
en2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles: