[ http://jira.codehaus.org/browse/MNG-490?page=comments#action_41763 ]
Rahul Thakur commented on MNG-490:
----------------------------------
ok, an update on this one and some notes :
'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...
> Creating an archetype with a different folder structure for java and test
> sources still results in default (src/main/java) folder being generated.
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: MNG-490
> URL: http://jira.codehaus.org/browse/MNG-490
> Project: Maven 2
> Type: Bug
> Environment: Windows XP, JDK 1.5.0, Maven2 SVN
> Reporter: Rahul Thakur
> Fix For: 2.0-beta-1
>
>
> Creating an archetype with a different folder structure for java and test
> sources still results in default (src/main/java) folder being generated, even
> though these are being created empty.
> I created an archetype and need to follow a set folder structure (all java
> sources to sit under folder "src" and tests under "test" folder respectively)
> Also the Archetype plugin makes an assumption that the archetype resources
> will always reside under "archetype-resources/". User should be able to
> override this and specify a custom name.
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]