如何从正在运行的应用程序中找出Groovy运行时版本? [英] How do I find out Groovy runtime version from a running app?
本文介绍了如何从正在运行的应用程序中找出Groovy运行时版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要能够通过groovy脚本找到Groovy运行时的版本。
我该怎么做?我在网上找到的例子显示了一种方式,但显然它已被废弃并在最新版本中被删除。
应该有效:
println GroovySystem.version
只要您使用Groovy 1.6.6 +
在此之前,它是:
println org.codehaus.groovy.runtime.InvokerHelper.version
但是,它已从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.
解决方案
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
这篇关于如何从正在运行的应用程序中找出Groovy运行时版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文