Howdy,

As for [2], the nexus-indexer tries it's best to "recognize" (or guess is
maybe better) is an artifact an archetype or not, exactly because of that
mixup with packaging, etc. Considering all archetypes out there in central,
there is no "unique way" to decide... when an artifact is recognized as
archetype (or even "partial archetype"), the indexer _overrides_ the
packaging on index and makes it uniformly "maven-archetype" packaging (yes,
even for those that has POMs saying different).

And finally, the nexus-archetype CLI (used on central to generate the
catalog, but same stands for Nexus Archetype Plugin, that uses same
components) will simply put only those artifacts into catalog, that on index
have packaging (are "recognized" as) maven-archetype.

Actually, this index creator is meant to "override" the packaging to
maven-archetype if needed, hence, to recognize "older" archetypes, since
newer ones already presents themselves with correct packaging, and packaging
is handled in generic fashion by MinimalArtifactInfoIndexCreator:

Following steps are done to recognize archetypes (below).

- if packaging is "maven-archetype", or extension is not "jar", no action
needed (the "minimal" index creator already sets packaging)
- if extension is "jar", and the JAR contains some of these resources:
"/META-INF/maven/archetype.xml", "/META-INF/archetype.xml",
"/META-INF/maven/archetype-metadata.xml", override it's packaging to
"maven-archetype"


Source code is here:
https://sventon.sonatype.org/repos/nexus-oss/show/trunk/nexus-indexer/src/main/java/org/sonatype/nexus/index/creator/MavenArchetypeArtifactInfoIndexCreator.java?revision=HEAD


Hope this helps to resolve problems about version 1.1 of webapp-javaee6

===

And as Herve said, it is best to use "proper" archetype packaging for any
new archetype.


Thanks,
~t~

On Tue, Sep 28, 2010 at 4:34 PM, Jesse Glick <jesse.gl...@oracle.com> wrote:

> [2] Another curious thing: though the mojo-archetypes appear to have always
> used jar packaging, and e.g. webapp-javaee6 in Central lists the packaging
> as jar when you download the POM for 1.0, 1.0.1, 1.0.2, and 1.1, the Central
> index lists the packaging as maven-archetype for 1.0, 1.0.1, and 1.0.2 - but
> not 1.1. Why?
>
> Furthermore, http://repo1.maven.org/maven2/archetype-catalog.xml lists
> 1.0, 1.0.1, and 1.0.2, but not 1.1. Nor, now, 1.2 - as someone was just
> complaining on us...@mojo, webapp-javaee6 1.2 is not offered by m2eclipse.
>
>

Reply via email to