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