Dynamic versions for pipeline libraries is supported with the library
step:
// A Jenkins file
library "name@${VERSION}"
doSomething()
Where doSomething()
is implemented in vars/doSomething.groovy
and forms a custom step.
What is not clear to me in the Loading libraries dynamically documentation is this sentence:
Using classes from the
src/
directory is also possible, but trickier.
There are THREE places where this statement could apply:
- In the Jenkinsfile - as it may need to import classes in
src/
- In the
vars/doSomething.groovy
global variable (aka “custom step”) - as they may need to import classes insrc/
- In the groovy files under
src/
- as they may need to import classes fromsrc/
So when it says “trickier”, where is it trickier? In all three places?