How to properly mixin libraryResource() pipeline step???

469 views
Skip to first unread message

TInaTinaTian L

unread,
Apr 25, 2017, 5:45:28 PM4/25/17
to Jenkins Developers
Hello,

package com.mycompany;
import org.jenkinsci.plugins.workflow.libs.*;

this.metaClass.mixin(ResourceStep)
def read(fileName) {
return libraryResource(fileName)
}

return this

I have the above LibraryResource.groovy file that basically just delegates to the libraryResource() pipeline step from the Jenkins Pipeline steps. I can't find a way to compile it unfortunately. 
I probably need to import the right class first and then mixin that class into the above LibraryResource class I wrote??? 
Any help is welcome :)

TInaTinaTian L

unread,
Apr 25, 2017, 5:47:14 PM4/25/17
to Jenkins Developers
I've been looking into the workflow-cps-global-lib-plugin repo but I don't understand how libraryResource() method is declared lol. I'm a newbie to groovy and OOP in general :(

Jesse Glick

unread,
Apr 26, 2017, 10:20:48 AM4/26/17
to Jenkins Dev
I think this is a question for the users’ list.
Reply all
Reply to author
Forward
0 new messages