yes, using maven-archetype packaging is recommended since it adds some lifecycle bindings to simple jar: - add-archetype-metadata - integration-tests - update-local-catalog see [1]
for your second point, I don't know: perhaps the nexus plugin that generates archetype-catalog.xml only considers jar packaging when querying its index. I added maven-archetype packaging in recent archetypes, when I discovered this quite unknown feature. For current archetypes trunk, see [2]: yes, svn structure has been reworked. Regards, Hervé [1] http://svn.apache.org/viewvc/maven/archetype/trunk/archetype- packaging/src/main/resources/META-INF/plexus/components.xml?view=markup [2] http://svn.apache.org/viewvc/maven/archetypes/trunk/ Le mardi 28 septembre 2010, Jesse Glick a écrit : > [Originally posted to d...@mojo without response. This might be the more > appropriate list, so reposting here also with some updates.] > > > Recently I worked on an IDE feature [1] which enumerates archetypes > available in your local repository that you might want to instantiate > projects from, so you can pick from a list, and ran into a problem which > I'm not sure I have solved satisfactorily. > > If the archetype used <packaging>maven-archetype</packaging> then the > install phase seems to insert an entry in archetype-catalog.xml, which > makes it easy to find in the local repo. Archetypes from a remote repo are > also easy to find because the Nexus indexer records the packaging for > every artifact, so you can do a Lucene search on it, even if the remote > archetype-catalog.xml was missing or not up to date. And > archetype:create-from-project sets up this packaging - fine. > > But it seems that many real archetypes just use jar packaging. Those in > mojo-archetypes always have as far as I can tell. [2] Official ones like > Quick Start sometimes use the custom packaging. [3] To find these in the > local repository you need to add a custom index field looking for > archetype-metadata.xml [4] in the JAR artifact, and there is no clear way > to find them in a remote repository. > > So should mojo-archetypes/* be converted to use maven-archetype packaging > and new releases made? > > > [1] https://netbeans.org/bugzilla/show_bug.cgi?id=190401 > > > [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. > > > [3] It seems that newer "official" archetypes use the special packaging: > > http://svn.apache.org/viewvc/maven/archetype/tags/maven-archetype-quickstar > t-1.1/pom.xml?revision=938664&view=co > > (I cannot find the "trunk" version of this code - was the source tree > reorganized?) Older releases use jar packaging, as far as I can tell. > > > [4] archetype.xml seems to be an older and semideprecated format - right? > Yet quickstart 1.1 uses it. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
