I have a file with a list of tokens:
tokens.txt
foo
bar
baz
and a template file:
template.txt
public class @token@MyInterface implements MyInterface {
public void doStuff() {
// First line of generated code
// Second line of generated code
}
}
I want to generate the following source code files to target/generated-sources/my/package
:
- FooMyInterface.java
- BarMyInterface.java
- BazMyInterface.java
One of the generated source files look like this:
FooMyInterface.java
public class FooMyInterface implements MyInterface {
public void doStuff() {
// First line of generated code
// Second line of generated code
}
}
How can I do this with Maven ?