tags:

views:

255

answers:

1

In the pom for the archetype I'm creating (archetype-resources/pom.xml), I'm referencing ${project.build.directory}, which is causing an error when creating/generating a project from the archetype.

org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 15,column 18] : ${project.build.directory} is not a valid reference.

Am I missing something, or do I not have access to the standard maven2 properties when defining my own archetypes!?

+1  A: 

You do have access to the standard maven2 properties, but it is referring to the property of the POM.xml of the resulting project and not the project you started with when creating the archetype. I created an Axis2 archetype, and the project name was axis2 as well. the create-from-project then changed every "axis2" string with ${project.artifactid}. one of my dependencies was axis2-kernel.jar. when I wanted to create a project of my archetype and named it my-service, then the dependency changed to my-service-kernel.jar. I solved it by manually changing ${project.artifactid} with axis2 in the dependency right after I created the archetype and just before I deployed it

rperez