There is a similar problem in the Maven Archetype JIRA: http://jira.codehaus.org/browse/ARCHETYPE-422
At the time of this writing, it remains open.
To get a working archetype for my project, I took jboss-javaee6-webapp-ear-blank-archetype-7.1.3.CR1.jar and created a project using it. Then I changed the project to remove many jboss elements as we use WebSphere. After these changes, I start the creation from the project:
mvn clean archetype:create-from-project -Dinteractive=true
I modify archetype.groupId and archetype.artifactId to set the location where I want the archetype to appear in the repository and its name. I also change the value of the package, but accept the default values ββfor other elements.
Like you, it looks like everything is working fine. When I connect to the \ target \ generated sources \ archetype and run mvn install, the jar file is created with the appropriate path and name.
Then I use Eclipse to create the project, and it works fine. Great, right?
Therefore, I make some small changes more specific to our environment and follow the steps described above using the same group and artifact identifiers. Then I use Eclipse to generate the project, and it gives an error:
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Unable to find resource 'archetype-resources/pom.xml'
(I do not always get the same error on the command line for mvn archetype: generate, but I saw how this happens.)
For some reason, re-executing the steps and entering another archetype.artifactId file when creating from a project fixes this problem. It seems that something is damaged or changed when the archetype is updated, and m2e does not like it.
In any case, it might be worth a try. I will see if I can narrow down the problem, but for now I will use unique artifacts for each update.