I have a Jenkins Shared Library A and a Library B, both in separate folder structures. Is there any way to call methods from Library A inside Library B? Like so:
// Library A
def foo() {
println "hello"
}
// Library B
@Library('Library-A') // I can't get this library load to work
def bar() {
foo()
}
// Jenkinsfile
@Library('Library-B')
bar() // prints "hello" to stdout
This is almost a duplicate of this question, but the answers given are either to import both libraries to the Jenkinsfile or to merge both libraries into the same file structure. My question is whether I can call a method in Lib A directly from Lib B, when they are not in the same file structure.