Search code examples
jenkinsgroovygithub-api

Groovy shared library dependency does not install properly on Jenkins


I'm building a groovy shared library to be used in Jenkins and part of it is using the Kohsuke Github API as a dependency for git operations.

This worked perfectly in dev jenkins as I'm installing it with gradle as instructed in the documentation:

// https://mvnrepository.com/artifact/org.kohsuke/github-api
implementation group: 'org.kohsuke', name: 'github-api', version: '1.313'

On prod, I'm getting errors of missing functions:

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of 
method: org.kohsuke.github.GHRepository.createTag() is applicable for argument types: 
(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

Trying to list all function from the kohsuke utility class indeed does not find the function but I'm confused as to why it isn't there. I suspect that an older version of the package is installed on prod since listing the functions yields a smaller number of them.

I was not involved in the provisioning process of the Jenkins instance but I am able to manage plugins, configure, etc. Is there any setting that could interfere with the installation of the dependency that I'm missing?


Solution

  • Still no idea what was up with this. Deleted the global shared library from Jenkins config, added it again in the exact same way and it started working. Gonna wrap this up as Jenkins shenanigans and move on.