0

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?

1

Setup pipeline name and default version (e.g. master) in "Global Pipeline Libraries" settings. Then use them in your Jenkinsfile as following

#!/usr/bin/env groovy
@Library('YourGlobalPipelineName@YourDefaultVersion') _

pipeline {

}
| improve this answer | |
  • I'm not making a Jenkins pipeline. This is a job dsl seed script. – David West Jun 19 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.