3

I configured Jenkins shared library with git repo which has a structure:

resources
|__ some_files
src
|__ some_files
vars
|__ some_files

But i got an error: "Library expected to contain at least one of src or vars directories". What's wrong? I have mandatory directories.

Restman
  • 95
  • 1
  • 8

2 Answers2

2

The problem is incorrect exception text: https://issues.jenkins-ci.org/browse/JENKINS-62961

Restman
  • 95
  • 1
  • 8
  • You save my day. And it is quite strange that you cannot load ONLY resources this way. It is quite common design pattern to separate shared libraries from e.g. configuration files (e.g. yaml with config for the Kubernetes plugin in my case). – Adam Bogdan Boczek Feb 11 '21 at 13:37
0

I got the same error. I initially set a relative path in the library path configuration which does not work and caused the error. left it blank then used the same folder structure

before:

resources
|__ some_files
src
|__ some_files
library/vars
|__ some_files

after:

resources
|__ some_files
src
|__ some_files
vars
|__ some_files

Jenkins Library Configuration

emtee
  • 1
  • 1