Skip to content
Browse files

Improved: Remove Groovy Base script redundancy (OFBIZ-10806)

According to Groovy documentation [1] the following construction:

    CompilerConfiguration cfg = new CompilerConfiguration();
    groovyClassLoader =
        new GroovyClassLoader(GroovyUtil.class.getClassLoader(), cfg);

is equivalent to running the a script containing the ‘@BaseScript’
annotation.  Previously in ‘org.apache.ofbiz.base.util.GroovyUtil’
instead of choosing one solution, we were doing both.  Now we only
rely on the construction described above.


git-svn-id: 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
mthl committed Mar 2, 2019
1 parent e6a00e6 commit 164849a79664fd310f74248f826f79ffb001f3c4

This file was deleted.

@@ -57,16 +57,6 @@
groovyClassLoader = new GroovyClassLoader(GroovyUtil.class.getClassLoader(), conf);
groovyScriptClassLoader = groovyClassLoader;
* With the implementation of @BaseScript annotations (introduced with Groovy 2.3.0) something was broken
* in the CompilerConfiguration.setScriptBaseClass method and an error is thrown when our scripts are executed;
* the workaround is to execute at startup a script containing the @BaseScript annotation.
try {
GroovyUtil.runScriptAtLocation("ofbizhome://framework/base/groovyScripts/GroovyInit.groovy", null, null);
} catch (Exception e) {
Debug.logWarning("The following error occurred during the initialization of Groovy: " + e.getMessage(), module);


0 comments on commit 164849a

Please sign in to comment.
You can’t perform that action at this time.