How can I pass properties to an Archetype POM in archetype-resources?

View: New views
1 Messages — Rating Filter:   Alert me  

How can I pass properties to an Archetype POM in archetype-resources?

by JavaGeek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
I volunteered to help the Weld team create some JSR 299 archetypes.  There are going to be 4 or more archetypes that will have the same dependency versions, sometimes at different scopes.  I'd like to define properties in the archetype's parent POM and pass them to the poms in the archetype-resources folder.  

For example, I'd like to be able to define the property below in the parent pom.
<properties>
        <jsf.version>2.0.0-RC</jsf.version>
</properties>

and in src/main/resources/archetype-resources/pom.xml define:

<dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>${jsf.version}</version>
</dependency>

However, ${jsf.version} doesn't resolve, I get:
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 57,column 34] : ${jsf.version} is not a valid reference.

...and the generated project doesn't build for obvious reasons.

How can I pass a property to the src/main/resources/archetype-resources/pom.xml ?

Thanks in Advance,
Steven