Description
Since XWiki 1.5 it is not possible anymore to configure the list of macro files to be loaded. This used to be possible in velocity.properties.
Here is a patch proposal which uses an xwiki.cfg xwiki.render.velocity.macrolist parameter
===================================================================
— src/main/java/com/xpn/xwiki/render/DefaultVelocityManager.java (revision 12117)
+++ src/main/java/com/xpn/xwiki/render/DefaultVelocityManager.java (revision 12126)
@@ -184,7 +184,10 @@
} else {
// Gather the global Velocity macros that we want to have. These are skin dependent.
Properties properties = new Properties();
- String macroList = "/templates/macros.vm" + (cacheKey.equals("default") ? "" : "," + cacheKey);
+ String macroList = xcontext.getWiki().Param("xwiki.render.velocity.macrolist", "");
+ if (macroList.equals("")) { + macroList = "/templates/macros.vm" + (cacheKey.equals("default") ? "" : "," + cacheKey); + }properties.put(RuntimeConstants.VM_LIBRARY, macroList);
velocityEngine = velocityFactory.createVelocityEngine(cacheKey, properties);
}