From 7d675196927a6ee000e4143ee7ec5228a6ecad31 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Thu, 8 Dec 2016 11:18:27 -0800 Subject: [PATCH] When describing classes in a Pipeline Shared Library that have "data" they must be Serializable Fixes JENKINS-38868 --- content/doc/book/pipeline/shared-libraries.adoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/doc/book/pipeline/shared-libraries.adoc b/content/doc/book/pipeline/shared-libraries.adoc index c35c431b576..664f392c7da 100644 --- a/content/doc/book/pipeline/shared-libraries.adoc +++ b/content/doc/book/pipeline/shared-libraries.adoc @@ -229,7 +229,7 @@ constructor, or just one method: [source,groovy] ---- package org.foo -class Utilities { +class Utilities implements Serializable { def steps Utilities(steps) {this.steps = steps} def mvn(args) { @@ -238,7 +238,9 @@ class Utilities { } ---- -Which would be access from Pipeline with: +When saving state on classes, such as above, the class *must* impmlement the +`Serializable` interface. This ensures that a Pipeline using the class, as seen +in the example below, can properly suspend and resume in Jenkins. [source,groovy] ----