What Plugin is providing this class?

Issue

  • You are writing a groovy script which uses a particular library and the script
    is throwing a groovy.lang.MissingMethodException.
  • You are migrating jobs from one Jenkins instance to another. When your job
    runs you see ‘Unable to resolve class org.foo’.
  • You need to know which library is providing the class you are using.

Environment

Resolution

Don’t forget this handy trick to quickly learn which plugin is providing a particular
class. From the script console, simply print the class loader.

For example, let’s say I would like to know which plugin is providing the snakeyaml
Yaml utilities. Go to the script console and type:

println (org.yaml.snakeyaml.Yaml.class.classLoader)

Result
AntClassLoader[/opt/jenkins/plugins/blueocean-rest-impl/WEB-INF/lib…

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.