-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gplus:execude does not find dependent scripts in same folder #80
Comments
One option you could do is parse the dependent script in the script that depends on it, as described here (https://stackoverflow.com/a/15904699/160256). I'm not sure there's a great way to execute them within GMavenPlus in the way described in the link. The Groovy scripts aren't directly compiled by GMavenPlus before they are executed, it's just run with groovy.lang.GroovyShell. To do as that author suggests, I think I'd have to write the compiled scripts to a temp directory (not hard), then execute them by dropping into the system shell with java.lang.ProcessBuilder and use whatever JAVA_HOME Maven was invoked with to execute the classes (which seems fairly messy). If you have a better idea for how this could be done, let me know. |
Thanks for your answer. I think the most elegant way would be to switch from the GroovyShell to GroovyScriptEngine. The GroovyScriptEngine loads depending classes dynamically from the scripts in the same folder. What do you think? Would it be a huge effort? |
Any help is most welcome. There's no real setup, just have Maven and JDK. Project is pretty straight-forward. The only thing that makes it a bit hard to read is that we have to use reflection to access Groovy classes so that the plugin will work with all Groovy versions and not have to have the "providers" GMaven had. GMavenPlus allows executing scripts defined in the POM itself without needing a script file, so I guess we'd also have to be able to choose between GroovyScriptEngine and GroovyShell at runtime. It also looks like there's no way to bind properties with GroovyScriptEngine, so all the things like |
I have two scripts, where one script depends on the other as it initializes an object of ist class.
This is explained in this blog:
https://www.jmdawson.net/blog/2014/08/18/using-functions-from-one-groovy-script-in-another/
this does not work with mvn gplus:execude.
The text was updated successfully, but these errors were encountered: