Resource resource = getResource("missingModuleId.groovy");
ErrorHandler handler = new DefaultErrorHandler();
DescriptorParser parser = new DescriptorParser(handler);
parser.initialize(resource, new DefaultClassResolver());
GroovyCodeSource source = new GroovyCodeSource(resource.getResourceURL());
Script script = new GroovyShell().parse(source);