Executing a Katalon Recorder script from an independant Java program

I would like to execute a Katalon studio script from a Java program calling it.

To achieve this I set up in Intellij a new Groovy project.

I copied all the jars from the plugins directory of the Katalon Studio Eclipse based IDE to have them available in my Groovy project.

Then I copied the intended Groovy script from Katalon Studio to Intellij, as a new Groovy file.

I saw that I had to select JDK8 instead of JDK11 to avoid some Groovy startup errors.

Next step was to avoid a null pointer exception from failure to load a ChromeDriver instance.

I wrote the following code
setProperty(“webdriver.chrome.driver”, “C:\lib\chromedriver.exe”)
options = new ChromeOptions();
options.setHeadless(false);
options.addArguments(“enablePageLoadTimeout”, “20”)
driver = new ChromeDriver(options);
//Link instanciated ChromeDriver to WebUI
DriverFactory.changeWebDriver(driver)
//Use the new defined browser but it fails due to reinitialization of properties with missing config when the corresponding values should have been taken from the already instanciated ChromeDriver!
WebUI.openBrowser(’’)

See the corresponding stack trace,

java.lang.NullPointerException
at com.kms.katalon.core.configuration.RunConfiguration.getExecutionGeneralProperties(RunConfiguration.java:434)
at com.kms.katalon.core.webui.driver.DriverFactory.isEnablePageLoadTimeout(DriverFactory.java:1176)
at com.kms.katalon.core.webui.driver.DriverFactory.setTimeout(DriverFactory.java:769)
at com.kms.katalon.core.webui.driver.DriverFactory.changeWebDriverWithoutLog(DriverFactory.java:248)
at com.kms.katalon.core.webui.driver.DriverFactory.changeWebDriver(DriverFactory.java:240)
at com.kms.katalon.core.webui.driver.DriverFactory$changeWebDriver.call(Unknown Source)
at KatalonTest.run(KatalonTest.groovy:42)

So my question is how I can avoid such a call to already filled configuration options (i.e. the isEnabledPageLoadTimeout setting)?
Or, if not possible to avoid such a parasitic re-initialization call, then how can I recreate a proper configuration in my Intellij project i.e. what exactly to be copied from the Katalon Studio Eclipse environment for that?

Some hints

One can have a glimpse of what The RunConfiguration code is doing from katalon-studio-testing-framework/DriverFactory.java at master · katalon-studio/katalon-studio-testing-framework · GitHub

This is complicated by the fact that a Katalon Studio project is automatically generating a GlobalVariable instance per project which itself is taken as source to fill a RunConfiguration instance.

AFAIK I’ll don’t need all that paraphernalia, but instead just avoid to redefine what is already set up from my ChromeOptions.