문제

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.

다른 팁

I installed Groovy v2.4.3 to /usr/share/groovy and then in my jenkins post-build task I reference my script as /usr/bin/groovy myscript.groovy similar to how @passionne described.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top