title: Where does Freemarker load templates in a maven generated jar
body: <p>Let me clarify my current practice. I have a maven project and the package architecture looks like below:<br>
  <em>src/main/java/com/gearon/app/App.java<br>
  src/main/java/com/gearon/app/configuration/Config.java<br>
  src/main/java/com/gearon/app/datamodel/*.java</em></p>
  
  <p>I tried to set directory where to load templates in Config.java with code below:</p>
  
  <pre><code>    cfg = new Configuration();
      cfg.setClassForTemplateLoading(Config.class, "/templates");
      cfg.setDefaultEncoding("UTF-8");
      cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
  </code></pre>
  
  <p>I have put templates under <em>src/main/java/com/gearon/app/templates</em><br>
  The architecture is <em>src/main/java/com/gearon/app/templates/*.ftl</em></p>
  
  <p>It works fine if I run the code directly with main method. However, when I package the project into a jar, it fails to load templates and the error looks like below:</p>
  
  <pre><code>java.io.FileNotFoundException: Template "index.ftl" not found.
  </code></pre>
  
  <p>I'd like to know where to put those tempaltes.</p>