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

前端 未结 2 1580
攒了一身酷
攒了一身酷 2021-02-02 05:54

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 deprecate

2条回答
  •  你的背包
    2021-02-02 06:42

    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

提交回复
热议问题