[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-quickstart-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]

Reply via email to