problemzebra
problemzebra

Reputation: 521

Freemarker template engine and Maven

I'm using Freemarker in one of my projects. Setting up a project with Freemarker works as expected but now I'm having problems with using this lib in a Maven project. It seems that the templates are not found (I placed them in nearly every folder). The template path is configured in the web.xml:

...
<init-param>
   <param-name>TemplatePath</param-name>
   <param-value>/</param-value>
</init-param>
...

I start the Maven module via mvn jetty:run.

Where should I place the template files? How can I configure Maven to include these files into the WAR?

My pom file

Upvotes: 0

Views: 1899

Answers (2)

Brian Agnew
Brian Agnew

Reputation: 272347

I would expect to see them in src/main/resources/WEB-INF

See also this interesting blog posting on Maven/Freemarker interactions.

Upvotes: 1

problemzebra
problemzebra

Reputation: 521

Finally, I found the solution:

The template files must be placed in the WEB-INF folder.

web.xml:

...
<init-param>
   <param-name>TemplatePath</param-name>
   <param-value>/</param-value>
</init-param>
...

Upvotes: 0

Related Questions