简体   繁体   中英

What version of Groovy is the Jenkins groovy post build plugin using?

I have the Groovy and Groovy Postbuild plugins installed in Jenkins (1.554) and have it set to automatically install Groovy 2.2.1 when needed.

After having a problem with a constructor signature I dug a little deeper and round that Jenkins is actually using 1.8.9 by running this through the groovysh CLI.

groovy> import org.codehaus.groovy.runtime.InvokerHelper
groovy> println InvokerHelper.version

It appears that the groovy post build plugin is also using 1.8.9 based on the error message I get when I try to run my script.

How can I update this? I have already set the groovy plugin to use 2.2.1. Thanks!

Groovy Postbuild plugins use the groovy version included in Jenkins (1.8.9). You can't change it.

The problem is the same as the system script in Groovy Plugin .

If you need a newer version of groovy a workaround is to do your work in a build (like Groovy Plugin purpose). Write some informations in a text file. And Read it in Post build step to do what you want with jenkins context (create badge, add summary, etc.)

Note that you can access to build workspace in post build step with:

manager.build.project.getWorkspace()

Hope it helps.

我将Groovy v2.4.3安装到/usr/share/groovy ,然后在我的jenkins生成后任务中,将我的脚本引用为/usr/bin/groovy myscript.groovy类似于@passionne的描述。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM