Jeremy KUHN created ARCHETYPE-417:
-------------------------------------

             Summary: Access to the parent artifactId and groupId during module 
generation
                 Key: ARCHETYPE-417
                 URL: https://jira.codehaus.org/browse/ARCHETYPE-417
             Project: Maven Archetype
          Issue Type: New Feature
          Components: Archetypes
    Affects Versions: 2.2
         Environment: all
            Reporter: Jeremy KUHN


Hello,

In some use cases when generating modules in a multi-modules project, it would 
be good to have access to the current parent properties and more especially to 
the parent artifactId and parent groupId.

For instance, if we consider the following project structure:

- myProject [com.test.myProject-1.0]
    - webapps [com.test.myProject.webapps-1.0]
    - libs [com.test.myPorject.libs-1.0]

When creating a new webapp using whatever archetype under the webapps folder, 
there's no way to tell the plugin to set the groupId of the new module to 
com.test.myProject.webapps.

There are couple of workarounds:
- don't set any groupId in the new module but then it will inherit the parent 
groupId which is com.test.myProject (we loose the webapps or libs which is not 
what we want)
- use the variables ${project.parent.groupId} and ${project.parent.artifactId} 
to set the modules's groupId but this brings instability and might not be 
supported in future version of Maven.

so the solution would be to be able to use parentGroupId and parentArtifactId 
properties when generating the module, having something like:
...
<groupId>${parentGroupId}.${parentArtifactId}</groupId>
...

in the archetype resources' pom.xml. 

and of course doesn't prompt for the groupId while generating the module (this 
can be done with default values in the archetype's metadata) 

Regards




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to