FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

Groovy Loader Project

v3.0 Public

This download includes a full blown sample application and the groovy loader plugin.  For just the plugin, look at the plugin contribution type.

This plugin is thanks to Barney Boisevert for his cfgroovy inspiration.

This plugin dynamically loads a coldbox application with the groovy runtime and other java libraries you so desire. You can configure a classpath within your application that will act as the root of what you want to execute or you can dynamically use the groovy scripting tags.

The groovy loader plugin also leverages the coldbox cache in order to store the java class files the groovyloader creates from script. Internally, the groovy class loader also caches the parsed classes so they are not re-parsed at runtime. The plugin includes two methods to interact with these caches:

  • clearClazzCache() : Cleans the coldbox cache of loaded groovy scripts
  • clearClassLoaderCache() : Cleans the actual classloader's cache, use sparingly

Why would I want to clear the class loader cache? You want to do this, whenever you make changes to the groovy files on disk. However, be warned that classloading is a very tempestous beast and it can lead to memory leaks or JVM permGen errors as class definitions do not get garbage collected or disposed of. However, this side effect is only visualized on development.


  • ColdFusion 9 and above
  • Railo 3.0 and above


Copy the plugin folder: GroovyLoader to your custom plugins or bring them in via the MyPluginsLocation or PluginsExternalLocation setting. Then either configure the class path and plugin like in the sample application:

<cfset getMyPlugin("GroovyLoader.GroovyLoader").configureClassPath(getSetting("ApplicationPath") & "model/groovy")>

Or just use the GroovyStarter interceptor, way easy:

interceptors = [
 { class="#appMapping#.plugins.GroovyLoader.GroovyStarter",
   properties = { groovyLibPaths = "/#appMapping#/model/groovy,/#appMapping#/model/anotherPath",
                  javalibPaths = "/#appMapping#/model/lib" }


  • Updated to ColdBox 3.6 standards
  • Updated for ColdFusion 9
  • Updated to pass in the private request collection to groovy bindings
  • Updated to pass in the request scope to groovy bindings
  • Updated all examples and cleanup
  • Better cache utilizations and retrievals


  • Added ability to load more than 1 location for groovy scripts
  • Added ability to load more than 1 location for java libraries alongside groovy language
  • Added the GroovyStarter interceptor for easy loading of the runtime, fully configurable


  • Initial groovy integration

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
3.0 Nov 25 2009 03:29 AM Jun 10 2016 06:23 AM


No collaborators yet.
5.00 / 2
  • Nov 25 2009 03:29 AM
  • Jun 10 2016 06:23 AM
  • 10810
  • 6979
  • 4