How do I load a Jenkins Shared Library in a Jenkins Job DSL seed?

HOW TO -️ October 18, 2021

I have a seed job using the plugin Jenkins Job DSL. I also have a shared library.

I have tried using the @Library annotation to load the script and the library method. It cannot find the annotation and using library yields the following error:

No signature of method: simple_pipeline.library() is applicable for argument types: (java.lang.String) values: [platform-engineering-library@master]

How do I load a Jenkins Shared Library in a Jenkins Job DSL seed?

Answer

Which solution work for you ?

Initializing...