This is one thing that does not work directly with Maven
In other to get it to work you have to download jsr223-engines.zip from https://scripting.dev.java.net/servlets/ProjectDocumentList
After that you have to unpack it, and install it into the Maven repository:
mvn install:install-file -Dfile=groovy-engine.jar -DgroupId=org.codehaus.groovy -DartifactId=groovy-engine -Dversion=1.5.1 -Dpackaging=jar
The class ScriptEngineCache establish connection to the scripting engines, by name of the language.
There is a static method call to get a new scripting engine for a scripting language.
Normally it will get the same scripting engine for a scripting language.