You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "luke w patterson (JIRA)" <ji...@codehaus.org> on 2010/01/03 21:02:55 UTC

[jira] Commented: (ARCHETYPE-273) add goal to import remote archetype catalog into local catalog

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

luke w patterson commented on ARCHETYPE-273:
--------------------------------------------

> Here is a new patch ... 
> New mojo has been renamed to ImportMojo ... 
> since it now supports importing not only all archetypes 
> but also importing just single fully specified archetype

Thanks Stevo, I applied the patch locally and tested it.

I only ran into one issue:

org.apache.maven.archetype.source.ArchetypeDataSourceException: Error parsing archetype catalog.
        at org.apache.maven.archetype.source.CatalogArchetypeDataSource.readCatalog(CatalogArchetypeDataSource.java:202)
        at org.apache.maven.archetype.source.RemoteCatalogArchetypeDataSource.getArchetypeCatalog(RemoteCatalogArchetypeDataSource.java:114)
        at org.apache.maven.archetype.DefaultArchetype.getRemoteCatalog(DefaultArchetype.java:210)
        at org.apache.maven.archetype.DefaultArchetype.getRemoteCatalog(DefaultArchetype.java:201)
        at org.apache.maven.archetype.mojos.ImportMojo.execute(ImportMojo.java:153)

You'll get that error if the remote repo's archetype-catalog.xml file is missing or empty.  At first I thought it was just an ordering issue in ImportMojo.execute, where the single import stuff should be done first, but as I dig deeper it looks like there are some more checks around the archetype entry's existence in archetype-catalog.xml.

> add goal to import remote archetype catalog into local catalog
> --------------------------------------------------------------
>
>                 Key: ARCHETYPE-273
>                 URL: http://jira.codehaus.org/browse/ARCHETYPE-273
>             Project: Maven Archetype
>          Issue Type: New Feature
>          Components: Archetypes
>    Affects Versions: 2.0-alpha-4
>            Reporter: Dan Allen
>         Attachments: org.apache.maven.archetype.maven-archetype-ARCHETYPE-220_&_273_interactive_combo.patch, org.apache.maven.archetype.maven-archetype-ARCHETYPE-273_&_220_combo.patch
>
>
> If I've just published a new archetype, I need to be able to provide the developer with a command that allows them to "educate" their local catalog about the new archetypes that area available. Currently, it's possible to specify an archetype catalog for a single run of the generate goal:
> mvn archetype:generate -DarchetypeCatalog=http://example.com/maven2
> But the catalog is transient. Those entries are not "remembered". The next time I run the generate goal...
> mvn archetype:generate
> ...the archetypes in the catalog provided in the previous command are not offered as options.
> This is especially problematic when using an IDE to create a new Maven project, because the mechanism for providing an archetype catalog differs in each IDE. We want them to be in the local repository. Simply point, it's too much information for the developer to have to reconcile, especially since using an archetype is likely the developer's first exposure to your project. It needs to be simple.
> What I'm looking for is a command that I can give the developer to import the entries from a remote archetype catalog. A discovery mechanism so to speak.
> I envision the following sequence to work:
> mvn archetype:import -DarchetypeCatalog=http://example.com/maven2
> mvn archetype:generate
> At this point, the developer would see options for the imported archetypes. The import goal could even download the archetype JAR files at the same time. 

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