on 2024 Jan 05 12:50 PM
Hi experts,
In terms of maximizing the reusability of my Groovy scripts, I am trying to use some custom functions located in CustomFunctions.groovy (which is inside my Script Collection), inside my Main.groovy (also in the same Script Collection).
I've tried to import the CustomFunctions through a GroovyShell but that resulted in a FileNotFoundException.
Any other way I can achieve this? Preferrably through an import statement (and not with a .jar)?
Any help would be much appreciated!
Thanks, Jan
GroovyShell shell = new GroovyShell()
Script script = shell.parse(new File('./CustomFunctions.groovy'))
javax.script.ScriptException: java.io.FileNotFoundException: /home/vcap/app/script/CustomFunctions.groovy (/home/vcap/app/script/CustomFunctions.groovy), cause: java.io.FileNotFoundException: /home/vcap/app/script/CustomFunctions.groovy (/home/vcap/app/script/CustomFunctions.groovy)
Request clarification before answering.
User | Count |
---|---|
64 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.