rootArtifactId is interpreted incorrectly in maven-archetype-plugin:2.0-alpha-5 (was okay in 2.0-alpha-4) ---------------------------------------------------------------------------------------------------------
Key: ARCHETYPE-301 URL: http://jira.codehaus.org/browse/ARCHETYPE-301 Project: Maven Archetype Issue Type: Bug Components: Generator Affects Versions: 2.0-alpha-5 Environment: Mac OS X 10.6.3, Java 1.6.0_17, Maven 3.0-beta-1 Reporter: Pat Podenski Priority: Critical Attachments: demo-archetype.zip Apparently a modification was made to the maven-archetype-plugin in 2.0-alpha-5 that has changed the way that rootArtifactId is interpreted. A similar issue has been reported, but with somewhat different symptoms (ARCHETYPE-298). If you install the attached demo-archetype (multimodule) and then create a project from it, rootArtifactId will be interpreted differently between 2.0-alpha-4 and 2.0-alpha-5. This demo-archetype uses the supplied artifactId (when creating a project) to 'derive' the desired parent and sub-module artifactIds with the following expressions in the respective archetype poms: parent artifactId ---- <artifactId>${artifactId}-parent</artifactId> module artifactId ---- <artifactId>${rootArtifactId}-module</artifactId> Steps to reproduce this problem using demo-archetype: 1] unzip demo-archetype.zip and build it (mvn install) to install in ~/.m2/repository. 2] Create a project from the demo-archetype using 2.0-alpha-4: mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate 3] Note that in the sub-module the parent artifactId is correct for the associated parent. 4] Then create a project from the demo-archetype using 2.0-alpha-5: mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-5:generate 5] Note that in this project sub-module the parent artifactId is NOT correct for the associated parent. For example, for a project whose input artifactId = purchase-order, the following results are obtained for the parent/module artifactIds in the respective cases: (A)** WITH 2.0-alpha-4 (correct results): parent coordinates are [org.foo:purchase-order-parent:1.0-SNAPSHOT] and sub-module coordinates are [org.foo:purchase-order-module:1.0-SNAPSHOT] - parent coordinates in sub-module are [org.foo:purchase-order-parent:1.0-SNAPSHOT] (B)** WITH 2.0-alpha-5 (incorrect results): parent coordinates are [org.foo:purchase-order-parent:1.0-SNAPSHOT] and sub-module coordinates are [org.foo:purchase-order-module:1.0-SNAPSHOT] - parent coordinates in sub-module are [org.foo:purchase-order:1.0-SNAPSHOT] In case (B) the '-parent' portion of the parent artifactId is missing. Instead of using the actual rootArtifactId (purchase-order-parent), the 'entered' artifactId is being used (purchase-order). The second case (B) will not build because the parent artifactId in the sub-module is not correct for the respective parent. -- 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