Hi All,
First off here is what is working. I have a normal shared library that I set up (Manage Jenkins > Configure System > Global Pipeline Libraries) that points to a repo in my GitHub account. At the top of my declarative Jenkinsfiles I have the line, `@Library('global-library')`. And I can call any .groovy file from the vars dir in that repo by simply referencing the script name in my Jenkinsfile, e.g. jiraCheck().
That is how I do things currently and it works. What I'd like to also do is have a folder in the project repo with "shared libraries" that are specific to the project and call it the same way within the Jenkinsfile as global shared libraries. Here is what I've tried (neither have worked).
In my project repo I have a folder called 'local-library/vars/' and under those folders I have a file called projSetup.groovy.
```
@Library(['global-library', 'local-library']) _
pipeline {agent none
stages {
stage('Test') { agent any
steps {
setup() // This comes from global-library
projSetup() //This should come from local-library
}
}
}
}
```
This method threw an error because it couldn't find the library 'local-library'.
I also tried to just reference the function with a relative path.
```
@Library('global-library') _
pipeline {agent none
stages {
stage('Test') { agent any
steps {
setup() // This comes from global-library
local-library/vars/projSetup() //This should come from local-library
}
}
}
}
```
This also threw an error.
Am I trying to use this feature correctly? Even if I'm not, how is this feature suppose to be used? Thanks for your help.