Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get complete maven archetype list

I'm trying generate a Maven project using archetype:generate but I only get a small list of archetypes:

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.)

Normally I get a list with more than 1000 elements. I tried with default central repository and the UK mirror but with the same result. I don't have a proxy.

like image 965
Carlos Durán Avatar asked Oct 19 '22 01:10

Carlos Durán


1 Answers

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>
like image 73
Tunaki Avatar answered Oct 28 '22 15:10

Tunaki