1

I want to set up an maven plugin that will take a few freemarker templates, and expand each one several times, each time with a different set of input values. Is there any better way to do this with fmpp that brute force processing them over and over?

bmargulies
  • 97,814
  • 39
  • 186
  • 310

2 Answers2

1

When you say set up a maven plugin, do you mean write your own?

If you want to just use fmpp with Maven and avoid writing a plugin you could do this:

Use the maven-antrun-plugin and process your files with a small snippet of Ant script using the fmpp Ant task (fmpp.sourceforge.net/ant.html). Combined with the ant-contrib task (ant-contrib.sourceforge.net/tasks/tasks/index.html) you should be able to loop quite easily over a set of files.

Peter Lynch
  • 525
  • 5
  • 9
1

Whether you use FMPP from a Maven plugin or not, the pp hash provides exactly what you need. Have a look at http://fmpp.sourceforge.net/pphash.html#key_changeOutputFile. You can call that function in a loop, producing a different output file for each iteration.

Laurent Pireyn
  • 6,735
  • 1
  • 29
  • 39