Description
With the following velocity.properties file (note the spaces after 'TypeConversions.vm'):
resource.loader = classpath
- this configuration allows you to supply template files somewhere on the classpath
classpath.resource.loader.description = Velocity Classpath Resource Loader
classpath.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
velocimacro.library=TypeConversions.vm
---------
One gets the following log entries:
Fri Oct 27 10:42:39 CEST 2006 [info] Velocimacro : adding VMs from VM library template : TypeConversions.vm
Fri Oct 27 10:42:39 CEST 2006 [error] ResourceManager : unable to find resource 'TypeConversions.vm ' in any resource loader.
Fri Oct 27 10:42:39 CEST 2006 [info] Velocimacro : error using VM library template TypeConversions.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'TypeConversions.vm '
It took me a few hours to notice that there were spaces after the '.vm' - it would maybe be better to add a trim() to VelocimacroFactory.initVelocimacro(), about line 164:
if (lib != null && !lib.equals(""))
{
/*
- let the VMManager know that the following is coming
- from libraries - need to know for auto-load
*/
lib = lib.trim(); // NEW
vmManager.setRegisterFromLib( true );
logVMMessageInfo("Velocimacro : adding VMs from " +
"VM library template : " + lib );
—