Search code examples
javamavenvelocity

How to create multiple files using one template in Maven Custom Archetype (Apache Velocity)?


What I want to achieve is use the code below from archetype-metadata.xml in order to create as many files as the items below, from one template.

<requiredProperty key="item_1">
    <defaultValue>item_1</defaultValue>
</requiredProperty>
.
.
.
<requiredProperty key="item_n">
    <defaultValue>item_n</defaultValue>
</requiredProperty>

Solution

  • I quit using Custom Maven Archetypes because it can't create multiple files from one template. Instead, I used the Velocity Engine and I was able to do all what I want with complete freedom.