Jenkins Pipeline - Call functions in shared jar
Asked Answered
V

0

11

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
Vandenberg answered 10/9, 2017 at 5:5 Comment(8)
the way jenkins pipeline shared libraries are supposed to be distributed and consumed is well documented. What is the reason you're not using the documented path?Coppice
Here: jenkins.io/doc/book/pipeline/shared-librariesDillydally
All examples are for Global Shared Library. Mine is simple but doesn't work. I have library extension.jar copied into my workspace. I need to refer the library through the pipeline code.Vandenberg
I also don't want to refer to the git project as I have lot of dependencies in my project and would prefer to build a fatjar out of it. Please let me know if there are any solutionsVandenberg
It's not clear to me what problems you are having. What are the limitations of using Shared Library that are limiting you right now? What are you trying to accomplish?Pilliwinks
Shared libraries are of Groovy code. How did you put it in a java-jar file? Can you explain?Gamble
agree with @mvk_il, use the documented Jenkins Shared Library approach.Bogie
I'm voting to close this as it is unclear what you are asking.Pilliwinks

© 2022 - 2024 — McMap. All rights reserved.