Java 11 will no longer be supported in Jenkins in a few months, so I am attempting to upgrade my Jenkins servers to Java 21. This requires a Gradle upgrade as well, so I am upgrading that to 8.5. The Gradle upgrade requires a Groovy upgrade, so I am upgrading that to 3.0.22.
However, since Jenkins runs on Groovy 2.4 (https://issues.jenkins.io/browse/JENKINS-53372 this ticket has been around for years), I am running into an issue with the jobdsl plugin when trying to create jobs on the server. There was a change in the GroovyObject class from Groovy 2 to Groovy 3 that results in classes getting does not define or inherit an implementation of the resolved method 'abstract void setProperty(java.lang.String, java.lang.Object)' of interface groovy.lang.GroovyObject
which I believe has to do with the fact that the code is compiling with Groovy 3 from the gradle build and is attempting to be run with Groovy 2 in Jenkins.
I have tried to use the Groovy plugin and override the Groovy version being used in the jobdsl plugin with no luck.
Is there an easy way to upgrade the Jenkins Groovy version that I am missing? From everything I have seen that cannot be done.
Thanks!
Max Leroux is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.