code: public static Path getGroovyPluginLocation() {
          String resourceName = ClassPathUtils.classNameToResourceName(GROOVY2_COMPILER_PLUGIN_CLASS);
          Path path = ClassPathUtils.findRootPathForResource(resourceName, ExampleResourceLocator.class.getClassLoader());
          if (path == null) {
              throw new IllegalStateException("couldn't find groovy2 plugin jar in the classpath.");
          }
          return path;
      }
docs: Locate the classpath root which contains the groovy2 plugin.
  
  The ScriptModuleLoader will load the groovy2 plugin into the same classlaoder as the
  groovy runtime. To accomplish this, the loader requires the file location of the groovy2 plugin.
  This method is an example strategy for locating the plugin's jar file in a programmatic way.
  
  This strategy assumes that the classloader of this example application has the plugin in it' classpath.
  see {@link ExampleResourceLocator#getGroovyRuntime()}.