Failed to retrieve plugin descriptor for org.apache.maven.plugins错误解决方法

是用maven创建project时碰到下面的错误:

D:\codes\JSF>mvn archetype:create -DgroupId=com.tutorialspoint.test -DartifactId
=helloworld -DarchetypeArtifactId=maven-archetype-webapp
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1

Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.3.1/maven-install-plugin-2.3.1.pom

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.3.1: Plugin org.apache.maven.plugins:maven-install-plugin:2.3.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
.
.
.
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml

[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect

[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect
Downloading: repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml

[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect

[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (repo1.maven.org/maven2): Error transferring file: Connection refused: connect
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.479s
[INFO] Finished at: Tue Oct 18 12:44:58 BST 2011
[INFO] Final Memory: 1M/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 (C:\Users\krsl1254\.m2\repository), central (repo1.maven.org/maven2)] 

在maven的配置文件$maven\conf\settings.xml中增加代理信息即可:

<proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值