1

In my archetype-metadata.xml, I have a property defined like:

<requiredProperties>
    <requiredProperty key="foo"/>
</requiredProperties>

I can use Velocity for manipulation of text inside files, for example:

#set( $foo-lower = $foo.toLowerCase() )
...
<someTag>${foo-lower}</someTag>

I also use variable substitution in filenames, like: myfile__foo__.txt

Is there a way to apply Velocity pre-processing in a way similar to the approach used inside a file, so that I could use myfile__foo-lower__.txt?

Perhaps a way to globally define a new variable, that will apply to all substitutions everywhere?

jordanpg
  • 6,386
  • 4
  • 46
  • 70
  • 1
    Did you come accross this question? http://stackoverflow.com/q/29647938/1743880 – Tunaki Sep 23 '16 at 14:32
  • This works, but the solution there is not ideal, since it results in the new required property being presented to the user at generate time. Is there any way for this implementation detail to be hidden from the user? – jordanpg Sep 23 '16 at 14:45
  • No, I don't think it is currently possible. – Tunaki Sep 23 '16 at 15:16
  • Also related: http://stackoverflow.com/questions/23266464/can-i-convert-an-artifactid-to-a-classname-prefix-in-my-maven-archetype – jordanpg Sep 23 '16 at 19:43

0 Answers0