1

I have a directory structure like this:

  • .../GroovyScriptsRoot
    • SubfolderName1/script/ScriptName1.groovy
    • SubfolderName2/script/ScriptName2.groovy
    • SubfolderName3/script/ScriptName3.groovy
    • SubfolderName4/script/ScriptName4.groovy
    • ...

So I basically want to do something like this:

GroovyScriptEngine engine = new GroovyScriptEngine(new String[]{".../GroovyScriptsRoot"});

I tried it myself but the scripts do not get loaded. The full path to the scripts is required which is not really nice. Is there a workaround of some sort?

1 Answer 1

1

Hmm OK, I found out what is going on. Naturally, the problem was with me.

The GroovyScriptEngine correctly loads the scripts by their package name - which actually does not have to correspond to the package which they are into.

I was trying to load the scripts by using just their name. Silly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.