You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Raphaël Piéroni (JIRA)" <ji...@codehaus.org> on 2008/06/05 23:02:12 UTC

[jira] Commented: (ARCHETYPE-175) archetype returned from local catalog don't have metadata

    [ http://jira.codehaus.org/browse/ARCHETYPE-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=137563#action_137563 ] 

Raphaël Piéroni commented on ARCHETYPE-175:
-------------------------------------------

The properties are defined in the archetype descriptor.
This is the archetype-metadata.xml file located in META-INF/maven in any archetype's jar.

To access the descriptor of an archetype, one should use 
the org.apache.maven.archetype.common.ArchetypeArtifactManager plexus component and
ask it for the the desired descriptor using getFileSetArchetypeDescriptor or getOldArchetypeDescriptor
after having checked it is the proper type with isFileSetArchetype and isOldArchetype

You also can take a look at the DefaultArchetypeGenerationConfigurator class.

The properties in the achetype-catalog are not yet used and where initially intended 
to contain some execution properties for the post generation goals (which are not yet used too)

> archetype returned from local catalog don't have metadata
> ---------------------------------------------------------
>
>                 Key: ARCHETYPE-175
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-175
>             Project: Maven Archetype
>          Issue Type: Bug
>            Reporter: Eugene Kuleshov
>
> Archetype instance returned from the local catalog don't have metadata, such as properties. Catalog is obtained like this:
> {code}
>   PlexusContainer container = mavenEmbedder.getPlexusContainer();
>   org.apache.maven.archetype.Archetype archetype = 
>       (Archetype) container.lookup(org.apache.maven.archetype.Archetype.class);
>   ArchetypeCatalog catalog = archetype.getLocalCatalog(getId());
>   Properties properties = ((org.apache.maven.archetype.catalog.Archetype)
>      catalog.getArchetypes().get(0)).getProperties();
> {code}
> I expected to see non empty properties for the test project attached at MNGECLIPSE-612, which I added to the local Archetype catalog like this:
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <archetype-catalog>
>   <archetypes>
>     <archetype>
>       <groupId>org.apache.maven.archetypes</groupId>
>       <artifactId>maven-archetype-proptest</artifactId>
>       <version>1.0</version>
>       <description>Prop test</description>
>     </archetype>
>   </archetypes>
> </archetype-catalog>
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira