使用代理后面的命令行创建maven项目时出现问题

时间:2013-08-23 12:33:14

标签: maven testing proxy

我在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:

1 个答案:

答案 0 :(得分:0)

这是一个网络问题。目前您的防火墙阻止了maven repo http://repo.maven.apache.org/我想您需要更新setting.xml

中的更新代理URL,用户名和密码

同样显示Authentication Required的异常,所以我假设未配置代理凭据