Search code examples
javavelocity

How to edit a velocimacro without restarting velocity?


My velocity macros are being cached and I don't want them to be... not during development at least.

I've set the following properties in my properties file...

velocimacro.library.autoreload=true
file.resource.loader.cache=false
velocity.engine.resource.manager.cache.enabled=false

... but this doesn't seem to have done the trick

Using velocity properties, how can I configure velocity to not cache macros?

(I'm using velocity 1.6.4)

EDIT:

I don't think the line...

velocity.engine.resource.manager.cache.enabled=false

...is relevant to velocity


Solution

  • I have been having the same issue with NVelocity (C# port of velocity). Digging through their souce I found that the re-loading of the macros in the global name space are controlled by the following property.

    properties.SetProperty(RuntimeConstants.VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL, true);
    

    I havn't tested this with velocity but looking at their documentation the property exists and seem to do exactly what you need.