ScaryGhast ScaryGhast -4 years ago 305
Groovy Question

What's the syntax to create a Serializable Groovy Class for Jenkins Workflow/Pipeline

Working with Jenkins Workflow Groovy, I'm running into Serialization errors when trying to create objects for a dead simple class. What kind of syntactic sugar is required to pass the serializable test? The following code is failing. Adding the @Serializable line fails with "class is not an annotation in"

class TestClass {
def hello() {
println "halloooo"
def myobj = TestClass.newInstance()
node () {

Answer Source

Credit to izzekil for answering this.

class TestClass implements Serializable {}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download