2013-08-23 46 views
0

我在setting.xml中添加了正确的代理。但是当我运行mvn命令创建maven项目时:使用命令行代理创建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: 

回答

0

这是一个网络问题。目前您的防火墙阻止行家回购http://repo.maven.apache.org/我猜你需要在setting.xml

更新更新代理网址,用户名和密码也异常显示Authentication Required所以我假设代理凭证都没有配置

+0

我已经更新了代理网址,用户名,密码在setting.xml中。在某些系统中它正在工作,但在某些系统中它不工作 – Arpitk12

相关问题