[ http://jira.codehaus.org/browse/ARCHETYPE-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=178036#action_178036 ]
Olivier Billard commented on ARCHETYPE-156: ------------------------------------------- I also find this behavior very restrictive concerning flat hierarchies. Here is a small patch to permit using a flat hierarchy. It introduces a {{flatHierarchy}} boolean parameter in the archetype-metadata.xml root element : {code:xml} <?xml version="1.0" encoding="UTF-8"?> <archetype-descriptor flatHierarchy="true"> (...) </archetype-descriptor> {code} Effect is that modules that does not define a specific parent (such as the parent module itself) are not added with any parent. I had to introduce an additional parameter, as signatures only reference {{AbstractArchetypeDescriptor}}, and not the generated {{ArchetypeDescriptor}} that contains the parameter. If you find a better solution... This patch applies to trunk. *Note :* Concerning parent _modification_ on submodules, this behavior is fixed in version 2.0-alpha-5, by depending on a newer release of maven-model. Adding this patch will fix both issues (this issue and the flat hierarchy). > Incorrect <parent> after using archetype:create > ----------------------------------------------- > > Key: ARCHETYPE-156 > URL: http://jira.codehaus.org/browse/ARCHETYPE-156 > Project: Maven Archetype > Issue Type: Bug > Components: Plugin > Environment: Windows XP > Maven 2.0.7 > Reporter: Per Lindfors > Priority: Minor > > Hi, > I'm not sure if this is a bug or lack of functionality, but here it goes... > It seems that the archetype plugin (2.0-alpha-2) and the create-goal somehow > alters the information in the <parent> segment of the resulting pom compared > to what we have in the "template" pom. > In my case we would like to be able to have a root pom project with multiple > modules(ejb, war, jar etc). Each module has a <parent> which points to a > "super pom" in our repository instead of the root pom project. When creating > the modules with our archetype the module gets registred in the <modules> > segment in the root pom project, but the <parent> segment with groupId and > artifactId etc referes not to the "super pom" in our repo, but to the root > project. Why? > Desired result: > Root project pom.xml > ------------------------------- > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > <modelVersion>4.0.0</modelVersion> > <groupId>se.xxx.yyy</groupId> > <artifactId>yyy</artifactId> > <version>1.0-SNAPSHOT</version> > <packaging>pom</packaging> > <name></name> > <build> > ...... > </build> > <modules> > <module>project1</module> > <module>project2</module> > <module>project3</module> > </modules> > Modules pom.xml > -------------------------------------- > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > <modelVersion>4.0.0</modelVersion> > <parent> > <groupId>superpom-groupid</groupId> > <artifactId>superpom-artifactId</artifactId> > <version>superpom-version</version> > </parent> > <groupId>se.aaa.bbb</groupId> > <artifactId>project1</artifactId> > <version>1.0-SNAPSHOT</version> > <packaging>war</packaging> > ... > /Per -- 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