问题
So here is my project setup
- A separate groovy project
- 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.
来源:https://stackoverflow.com/questions/46137474/jenkins-pipeline-call-functions-in-shared-jar