Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find out Groovy runtime version from a running app?

Tags:

groovy

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.

like image 591
Alex Khvatov Avatar asked Sep 18 '13 15:09

Alex Khvatov


People also ask

How do I check my Groovy 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.

What version of Groovy does Jenkins use?

Groovy Postbuild plugins use the groovy version included in Jenkins (1.8. 9).

What is Groovy script in Jenkins?

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 )


1 Answers

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

like image 155
tim_yates Avatar answered Oct 15 '22 20:10

tim_yates