You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Rahul <ra...@clear.net.nz> on 2005/06/22 08:45:42 UTC

Creating an archetype with different folder structure still creates default folders (MSG-490)

Hi, 

Here are a few of notes for archetype creation (# MNG-490). Sorry about the duplicate post but wasn't sure if a long post on JIRA was good idea :-). Would be great if someone can comment (or any other thoughts) if I am on the right track here. 

Thanks, 
Rahul 



'archetype.xml' or archetype descriptor contains elements that need to be merged and copied over when a new archetype is being created. For projects with a custom archetypes/skeletons, it would be desirable to copy sources, testsources and resources defined in archetype.xml to appropriate directories referred by the POM template. 

This is how I have gone about implementing it so far: 
a) create a POM model instance from the generated POM for the archetype resources(skeleton resources).
b) check if following definitions are set up in generated POM : 
   b-1) sourceDirectory : if yes, create it and then process sources defined via archetype descriptor's <sources> tag and copy them to source directory defined in POM.
  b-2) testSourceDirectory: same deal as (b-1)
  b-3) resources/resource: Iterate and create directories for each resource and then copy over the one's defined in archetype.xml (<resource> tag)
 b-4) testResources/resource: same deal as (b-3)

Now, the problem I am hitting (assuming I am on right track!) is that if there is a directory defined as a resource in case of (b-3) and (b-4) I am not sure of a way to copy them over to the target archetype that is being setup. 

Also, I'd like to be able to specify nested resources via the archetype descriptor, for instance: 
[snip]
 <resources>
    <resource>bare/readme.txt</resource>    
    <resource>build/**</resource>               (this should copy 'build' dir and everything under it)
  </resources>
[/snip]

Ideally, I think we'd like to have everything defined by the archetype skeleton to be copied over to the target project. Do you think  this is a reasonable/rational extension to add to the existing archetype creation mechanism. 

Look forward to thoughts...


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org