I'd like individual
Velocity macro lookup loading to work similar to resource lookup with Java's resource bundle facility. Take, for example, the following Velocity setup.
// velocity.properties
resource.loader=file, class
// defined file and class resource loaders
velocimacro.library=user-macros.vm
So, if you've got a user-macros.vm file in one of the paths defined by the file resource loader, then the first path containing that file will be used. If Velocity can't find a given macro in that user-macros.vm file, it fails gracefully (it prints out the macro name in your template). In this example, I'd just like it to search the other file resource paths for another user-macros.vm file to see if the requested macro is in that file, and failing that, check the the user-macros.vm file from the classpath resource loader to see if the requested macro is available there.
Concrete example:
/some/file/resource/path/user-macros.vm - Contains Velocity macro #Baz
/some/file/path/user-macros.vm - Contains Velocity macros #Foo and #Bar
/WEB-INF/lib/velocity-macro-lib.jar - Contains a user-macros.vm file with Velocity macros #Boggle and #Fraggle
As the first path contains a user-macros.vm file, you can only use the #Baz macro in your templates. The #Foo, #Bar, #Boggle, and #Fraggle macros are "hidden". It's definitely more of a nice-to-have at this point.
Unless I'm missing something and there is a way to actually do this ...