Hi,

We have a sub-module that is a Maven Archetype.

Within the generated pom.xml I want to set some <properties> for versions:

https://github.com/apache/incubator-taverna-engine/blob/master/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml#L32


However I don't want to have to hard-code the versions within the
template pom.xml, but would rather want it to be inherited from the
<properties> in the parent of the archetype - that is so it running
the archetype would generate <properties> with actual version numbers
- but in the template pom.xml it would be something like

<taverna.language.version>${taverna.language.version}</taverna.language.version>


This is particularly important for our property taverna.engine.version
which must stay in -SNAPSHOT during development to make the test work:
https://github.com/apache/incubator-taverna-engine/tree/master/taverna-activity-archetype/src/test/resources/projects/dummyActivity

..but should change to a release version once releasing.


How can I achieve this?

I tried adding to META-INF/maven/archetype-metadata.xml

                <requiredProperty key="tavernaEngineVersion">
                        <defaultValue>${project.parent.version}</defaultValue>
                </requiredProperty>

but then the test fails:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-archetype-plugin:2.4:integration-test
(default-integration-test) on project taverna-activity-archetype:
[ERROR] Archetype IT 'dummyActivity' failed: Missing required
properties in archetype.properties: tavernaEngineVersion


obviously I can't just hard-code the version number in
archetypes.properties - as that would just
move the problem.


Any ideas?

-- 
Stian Soiland-Reyes
Apache Taverna (incubating), Apache Commons RDF (incubating)
http://orcid.org/0000-0001-9842-9718

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to