JStark
JStark

Reputation: 2788

How to use auto_import feature with FreeMarker and maven or ant (not servlet)

I'd like to test using freemarker to automatically build my html files at compile time (not use the servlet) and want to use the auto_import feature so I don't have to re define the template for each file. I can either use ANT or Maven. How do you use the auto_import feature to automatically load templates within FreeMarker using either ANT or Maven?

Upvotes: 0

Views: 1027

Answers (2)

ddekany
ddekany

Reputation: 31152

auto_imports is just one of the many FreeMarker settings, and it has nothing to do with servlets, Maven or Ant. So if you can process the files with Ant or Maven (one way is using the Maven FMPP plugin or the Ant FMPP task), then you should be able to use use auto_imports as well.

Update: There's an issue with FMPP (until 0.9.15 is released): it doesn't know this setting, so you can't set it through FMPP. But instead it has "Header and footer choosing", which is even more flexible. See: http://fmpp.sourceforge.net/settings.html

Upvotes: 1

Chaquotay inactive
Chaquotay inactive

Reputation: 2232

Have you tried FMPP?

FMPP is a general-purpose text file preprocessor tool that uses FreeMarker templates.

It can be used via command-line or Ant and might provide all the features you need.

Upvotes: 0

Related Questions