I need to be able to find out the version of Groovy runtime via a groovy script. How do I do it? The examples I found on the net show a way, but apparently it has been deprecated and removed in the latest version.
Step16: To check whether Groovy is installed correctly or not, click on Command prompt and type groovy ? v and press enter. It will display the installer version of groovy of your system.
Groovy Postbuild plugins use the groovy version included in Jenkins (1.8. 9).
Groovy is a very powerful language which offers the ability to do practically anything Java can do including: Create sub-processes and execute arbitrary commands on the Jenkins controller and agents. It can even read files in which the Jenkins controller has access to on the host (like /etc/passwd )
This should work:
println GroovySystem.version
So long as you are on Groovy 1.6.6+
Before that, it was:
println org.codehaus.groovy.runtime.InvokerHelper.version
But that's been removed from later versions of Groovy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With