尝试创建简单的 Maven 项目时插件不可用
当我尝试运行此 Maven 目标时 -
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
(取自 http://maven.apache.org/guides/getting-started/maven-in- Five-Minutes.html)
我收到此错误 -
INFO] Scanning for projects...
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
lean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 o
one of its dependencies could not be resolved: Failed to read artifact descrip
or for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
nstall-plugin/2.3.1/maven-install-plugin-2.3.1.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-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 des
riptor for org.apache.maven.plugins:maven-install-plugin:jar:2.3.1
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
eploy-plugin/2.7/maven-deploy-plugin-2.7.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or
ne of its dependencies could not be resolved: Failed to read artifact descripto
for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
ite-plugin/3.0/maven-site-plugin-3.0.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-site-plugin:3.0: Plugin org.apache.maven.plugins:maven-site-plugin:3.0 or one
f its dependencies could not be resolved: Failed to read artifact descriptor fo
org.apache.maven.plugins:maven-site-plugin:jar:3.0
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
ntrun-plugin/1.3/maven-antrun-plugin-1.3.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or
ne of its dependencies could not be resolved: Failed to read artifact descripto
for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
ssembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plu
in:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read
rtifact descriptor for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-b
ta-5
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
ependency-plugin/2.1/maven-dependency-plugin-2.1.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-dependency-plugin:2.1: Plugin org.apache.maven.plugins:maven-dependency-plugin
2.1 or one of its dependencies could not be resolved: Failed to read artifact d
scriptor for org.apache.maven.plugins:maven-dependency-plugin:jar:2.1
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
elease-plugin/2.0/maven-release-plugin-2.0.pom
WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:mave
-release-plugin:2.0: Plugin org.apache.maven.plugins:maven-release-plugin:2.0 o
one of its dependencies could not be resolved: Failed to read artifact descrip
or for org.apache.maven.plugins:maven-release-plugin:jar:2.0
ownloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadat
.xml
ownloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
etadata.xml
WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xm
from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org
WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/
o central (http://repo.maven.apache.org/maven2): repo.maven.apache.org
WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from h
tp://repo.maven.apache.org/maven2 was cached in the local repository, resolutio
will not be reattempted until the update interval of central has elapsed or up
ates are forced. Original error: Could not transfer metadata org.apache.maven.p
ugins/maven-metadata.xml from/to central (http://repo.maven.apache.org/maven2):
repo.maven.apache.org
WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://r
po.maven.apache.org/maven2 was cached in the local repository, resolution will
ot be reattempted until the update interval of central has elapsed or updates a
e forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-m
tadata.xml from/to central (http://repo.maven.apache.org/maven2): repo.maven.ap
che.org
INFO] ------------------------------------------------------------------------
INFO] BUILD FAILURE
INFO] ------------------------------------------------------------------------
INFO] Total time: 0.706s
INFO] Finished at: Fri Jan 20 16:49:34 GMT 2012
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
epositories [local (C:\.m2\repository), central (http://repo.mave
.apache.org/maven2)] -> [Help 1]
ERROR]
ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
h.
ERROR] Re-run Maven using the -X switch to enable full debug logging.
此插件可用吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否位于代理或防火墙后面?听起来好像看不到中央仓库。
Are you behind a proxy or firewall? Sounds like it can't see the central repo.
以下命令在我的电脑上运行良好:
这听起来确实像是 HTTP 代理问题...
The following command works fine on my PC:
This really does sound like a HTTP proxy issue...
如下所述修改您的setting.xml。
Modify your setting.xml as mentioned below.
您可以在 maven 的 settings.xml 文件中添加代理,如下所示:
You can add the proxy on the settings.xml file of maven like the following: