It's because of the *@NonCPS* annotation. It's incompatible with pipeline 
step calls. See more here 
<https://github.com/jenkinsci/workflow-plugin/blob/master/TUTORIAL.md>.

On Thursday, February 4, 2016 at 8:45:21 AM UTC-8, Oleh Olkhovskyy wrote:
>
> Hi,
>
> I'm writing a pipeline groovy script. and stumbled upon this problem:
>
> If I try to run step within a function, then function is immediately 
> terminated and doesn't execute following instructions.
> I.e.
>
> I have function:
>
> @NonCPS
> def getBuildOutput(build_job) {
>     echo "BeforeStep"
>     def prop_file=readFile('get_src_job_artifacts/output.properties')
>     echo "AfterStep"
>     //Execute further processing with non serializable variables
>     //....
>
>
> But when I call it, "BeforeStep" is echoed, but "AfterStep" is not.
> instead getBuildOutput returns string read from that file.
> Why is that, and is there a way to avoid that?
>
>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8ea9c94f-67ca-4abc-80ab-841a6c97e22d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to