无法获得完整的Maven原型列表 [英] Unable to get complete maven archetype list

查看:550
本文介绍了无法获得完整的Maven原型列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用archetype:generate生成一个Maven项目,但是我只得到了一小部分原型:

1: internal -> org.apache.maven.archetypes:maven-archetype-archetype (An archetype which contains a sample archetype.)
2: internal -> org.apache.maven.archetypes:maven-archetype-j2ee-simple (An archetype which contains a simplifed sample J2EE application.)
3: internal -> org.apache.maven.archetypes:maven-archetype-plugin (An archetype which contains a sample Maven plugin.)
4: internal -> org.apache.maven.archetypes:maven-archetype-plugin-site (An archetype which contains a sample Maven plugin site.
  This archetype can be layered upon an existing Maven plugin project.)
5: internal -> org.apache.maven.archetypes:maven-archetype-portlet (An archetype which contains a sample JSR-268 Portlet.)
6: internal -> org.apache.maven.archetypes:maven-archetype-profiles ()
7: internal -> org.apache.maven.archetypes:maven-archetype-quickstart (An archetype which contains a sample Maven project.)
8: internal -> org.apache.maven.archetypes:maven-archetype-site (An archetype which contains a sample Maven site which demonstrates
  some of the supported document types like APT, XDoc, and FML and demonstrates how
  to i18n your site. This archetype can be layered upon an existing Maven project.)
9: internal -> org.apache.maven.archetypes:maven-archetype-site-simple (An archetype which contains a sample Maven site.)
10: internal -> org.apache.maven.archetypes:maven-archetype-webapp (An archetype which contains a sample Maven Webapp project.)

通常我会得到一个包含1000多个元素的列表.我尝试使用默认的中央存储库和UK镜像,但结果相同.我没有代理人.

解决方案

更新:Maven Central的问题已修复,提供的临时解决方法是不再需要此答案. /p>


似乎Maven Central目录存在持续的问题.文件http://repo1.maven.apache.org/maven2/archetype-catalog.xml当前为空.

maven-archetype-plugin通常会下载此文件并提取所有定义的原型,这就像您过去所经历的那样,导致成千上万的原型.由于Maven Central目录为空,因此该插件默认为其内部原型(您可以在 解决方案

UPDATE: the problem with Maven Central has been fixed and the temporary work-around provided is this answer is no longer necessary.


It seems there is an on-going problem with the Maven Central catalog. The file http://repo1.maven.apache.org/maven2/archetype-catalog.xml is currently empty.

maven-archetype-plugin normally downloads this file and extract all the defined archetypes, which results in, as you experienced in the past, thousands of archetypes. Since Maven Central catalog is empty, the plugin is defaulting to its internal archetypes (and you can see what they are in the source code and notice there is only 10 of them, the result you are getting).

I reached out at the Maven mailing-list and am currently waiting for a response.

As a temporary workaround, you can define the following mirror of Maven Central in your settings.xml:

<mirrors>
    <mirror>
        <id>ibiblio</id>
        <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
</mirrors>

这篇关于无法获得完整的Maven原型列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆