Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Auto Closed
-
2.1
-
None
-
None
Description
When generating a new project from an archetype, it does not seem to be possible to populate the properties used by the Velocity engine with dynamic runtime values, other than the ones that are automatically provided by Java system properties.
What would be ideal is to have some hook in – some events or something – that would allow us to run arbitrary Java code packaged with the archetype JAR. But some mechanism is desired to be able to assign a dynamic value to the properties so that, for example, a timestamp or a dynamically-generated ID could be inserted into a filtered archetype-resource file when the project is generated from the archetype.
Supporting Java expressions in the requiredProperties in the archetype-descriptor might be one way to do it. So, for example:
<requiredProperties>
<requiredProperty key="current-date">
<dynamicInit>new Date()</dynamicInit>
</requiredProperty>
</requiredProperties>