Enforced parent of modules gets replaced by project parent
----------------------------------------------------------
Key: ARCHETYPE-368
URL: http://jira.codehaus.org/browse/ARCHETYPE-368
Project: Maven Archetype
Issue Type: Bug
Components: Creator
Affects Versions: 2.0
Environment: Maven 3.0.2
Reporter: Georges-Etienne Legendre
We want to have archetype that creates a project with modules. Child modules
should not inherit from the project POM. This is the model presented in the
Maven Guide: section 3.6.2.2
http://sonatype.com/books/mvnref-book/reference/pom-relationships-sect-multi-vs-inherit.html
Example:
{code}
test-project/
pom.xml: parent is com.test.pom:my-meta-parent
test-module1/
pom.xml: parent should be com.test.pom:my-parent-1
test-module2/
pom.xml: parent should be com.test.pom:my-parent-2
test-module3/
pom.xml: parent should be test-project
{code}
In the archetype, I have:
{code}
project-archetype/
src/main/resources/
__rootArtifactId__-module1/
pom.xml:
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.test.pom</groupId>
<artifactId>my-parent-1</artifactId>
<version>RELEASE</version>
</parent>
...
__rootArtifactId__-module2/
pom.xml:
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.test.pom</groupId>
<artifactId>my-parent-2</artifactId>
<version>RELEASE</version>
</parent>
...
__rootArtifactId__-module3/
pom.xml:
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}</artifactId>
<version>${version}</version>
</parent>
...
{code}
When the archetype is used to create a project, all <parent> of module get
replaced by the new project Pom.xml... They all end up with:
{code}
<parent>
<groupId>com.test.project</groupId>
<artifactId>test-project</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
{code}
Is there a way to fix this? Thanks!
--
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