Need help with Shared Libraries in Jenkins

22 views
Skip to first unread message

Sanjiv Kumar

unread,
Apr 2, 2017, 3:22:41 PM4/2/17
to Jenkins Users
Hi,

I am trying to implement a standard pipeline using Shared Libraries in Jenkins. I understand the directory structure for the same.

(root)
|
|----- src
|
|----- vars
|
|----- resources

I have declared variables in vars directory in groovy files. How I can access these variables in the groovy files src/com/xyz/a.groovy.

vars/b.groovy

import groovy.transform.Field

class Git {
   @Field final Name = 'xyz'
}

return this;

I want to access the value of Name variable in src/com/xyz/a.groovy. Is it possible?

Any kind of help is highly appreciated.

Thanks,
Sanjiv
Reply all
Reply to author
Forward
0 new messages