Jenkins Pipeline - Call functions in shared jar

2019-06-15 07:02发布

问题:

So here is my project setup

  1. A separate groovy project
  2. Multiple pipelines

All the pipeline scripts refer to the shared groovy project. I went through the shared libraries and all of the needs to be registered in Jenkins global configuration.

Is there any way to do without it? I tried using Grab but ended up with the error

java.lang.RuntimeException: No suitable ClassLoader found for grab

回答1:

Firstly for Grab to work your Jenkins needs to have access to the internet.

Shared Libraries are definitely the way to go here.

Like many things the secret sauce is in the syntax.