Pipeline hanging with @NonCPS method returning Serializable

200 views
Skip to first unread message

Torsten Reinhard

unread,
Dec 20, 2016, 10:47:24 AM12/20/16
to Jenkins Users
Hi,

I´ve created a simple Pipeline using a class (SSHParams) from my shared library:

public class SSHParams implements Serializable {
   
String unixuser
   
String dir
   
String hostname
   
   
/**
     * ctor.
     *
     * @param unixUser
     * @param hostname
     * @param dir
     */

   
public SSHParams( String unixUser, hostname, dir ) {
        setUnixuser
(unixUser)
        setHostname
(hostname)
        setDir
(dir)
   
}
   
...
}


import com.mycompany.SSHParams
import com.cloudbees.groovy.cps.NonCPS

@NonCPS
def sampleOutput() {
   
SSHParams params = new SSHParams("user","hostname", "dir")

   
return params
}

stage
"1st stage"
println sampleOutput
().toString()

This pipeline starts - and is hanging without any output:

[Pipeline] stage (1st stage)
Using the stage step without a block argument is deprecated
Entering stage 1st stage
Proceeding
Aborted by .....
Click here to forcibly terminate running steps
Terminating stage (1st stage)
Click here to forcibly kill entire build
Hard kill!
Finished: ABORTED


What´s going wrong here ?

Thanx for any hints,

Torsten

Torsten Reinhard

unread,
Dec 21, 2016, 4:24:31 AM12/21/16
to Jenkins Users
Reply all
Reply to author
Forward
0 new messages