On Saturday, 11 February 2017 00:49:42 UTC-5, David Karr wrote: > > I'm seeing some odd behavior with "println" calls in shared library > methods, and a perhaps related issue with printing a shared library object > in a Jenkinsfile. >
Nice to see an answer to this by Jon S a month later where he suggested to pass the "this" reference to the "src" class instance (apparently it has an interface Script). Calling script.echo("...") in a method of that instance will work. (Without binding to the script object, my bare "echo" in an "src" instance method resulted in a silent termination of the step). Jon S also suggested to add a @NonCPS annotation to the "src" instance methods and declare the "src" class Serializable to allow executing the method from the context of a slave node. https://stackoverflow.com/questions/42149652/println-in-call-method-of-vars-foo-groovy-works-but-not-in-method-in-class -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/bf532834-56f4-450b-ade9-3757cc481311%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.