I'm testing out use of shared libraries by trying to expand on some of the sample code from
https://jenkins.io/doc/book/pipeline/shared-libraries/. I created the 'sayHello' step and thought I'd try to call that step from a class with the goal of being able to provide pre-packaged pipelines in the form of a class, with the flexibility of using the steps directly if necessary. I've tried multiple variations of the 'execute' method in HelloWorldPipeline, but can't seem to figure out how to reference the 'sayHello' step. Compounding my confusion is the error message I get seems to indicate that 'sayHello' is in fact present in globals:
[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: No such DSL method 'sayHello' found among steps [ArtifactoryGradleBuild,..., zip] or symbols [all,..., zip] or globals [Artifactory, currentBuild, docker, env, params, pipeline, sayHello, scm]
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:149)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)...
The file structure and code that I'm using follows. Any help would be greatly appreciated!
Thanks!
--- Chris