Following the Javadoc for StringResourceLoader I have my velocity.properties setup as follows:
------------------------------- template.encoding = UTF8 input.encoding=UTF-8 output.encoding=UTF-8 velocimacro.library=VM_global_library.vm resource.loader = string string.resource.loader.description = Velocity StringResource loader string.resource.loader.class = org.apache.velocity.runtime.resource.loader.StringResourceLoader string.resource.loader.repository.class = org.apache.velocity.runtime.resource.util.StringResourceRepositoryImpl -------------------------------- The problem I have is that Velocity cannot find my VM_global_library.vm. I can see why the StringResourceLoader wouldn't know what to do with "VM_global_library.vm", but I as per the velocimacro.library docs at http://velocity.apache.org/engine/devel/developer-guide.html: ---------------------------------- velocimacro.library = VM_global_library.vm Multi-valued key. Will accept CSV for value. Filename(s) of Velocimacro library to be loaded when the Velocity Runtime engine starts. These Velocimacros are accessable to all templates. The file is assumed to be relative to the root of the file loader resource path. ----------------------------------- ...it doesn't mention how or if this can be configured when using a StringResourceLoader. What is the best way to load global macro files when using a StringResourceLoader?