Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-alpha-3
-
None
-
Maven version: 2.0.9
Java version: 1.6.0_06
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
Description
The 'archetype:create-from-project' goal when used does not generate the correct values for the groupId and the artifactId of the new archetype being created.
Instead the values from the original maven structured project serialized into the new pom.xml for the newly generated archetype. This means that the new archetype when installed within the artifact repository will occupy the space of the original project. The original project values are are used during the creation process regardless of whether the user has specified to use the plugin through interactive mode.
I started out with a new maven project generated from the quickstart archetype. The pom.xml file contained the following values
groupId: com.mycompany.example
artifactId: myapp
I executed
mvn archetype:create-from-project -Dinteractive=true
The 'archetype:create-from-project' goal reported the following values back to me
archetype.groupId=com.mycompany.example
archetype.artifactId=myapp-archetype
archetype.version=1.0-SNAPSHOT
version=1.0-SNAPSHOT
package=com.mycompany.example.myapp
groupId=com.mycompany.example
artifactId=myapp
I expected to see a newly generated archetype project with the following value within the pom.xml file
groupId: com.mycompany.example
artifactId: myapp-archetype
Instead I was left with a generated archetype that contained a pom.xml file with the following values
groupId: com.mycompany.example
artifactId: myapp
No matter how I interact with the plugin goal I cannot pass through the correct value for the groupId and artifactId elements. I have even tried adding additional properties with the same keys with the aim of overwriting the generated values. This still resulted in an incorrect pom.xml. After generation I had to manually change the values before running 'mvn install'.