Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit a velocimacro without restarting velocity?

Tags:

java

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

like image 511
Edd Avatar asked Apr 06 '11 14:04

Edd


1 Answers

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.

like image 149
Prin Avatar answered Sep 20 '22 18:09

Prin