Jenkins pipeline java.io.NotSerializableException java.util.regex.Matcher error even with @NonCPS
问题 I am using @NonCPS in front of my Jenkinsfile function which performs a regex match and i'm still getting java.io.NotSerializableException java.util.regex.Matcher error even with the @NonCPS annotation. Note, it calls the function many times and the exception only occurs once a match is actually made. Here is my code: @NonCPS def extractEndTime(logLine) { def MY_REGEX = /.*(20[0-9]{2}-[0-9]{2}-[0-9]{2}).([0-9]{2}:[0-9]{2}:[0-9]{2}).*\"\w+\"\sthe text\s(\w+)\./ m = (logLine =~ TEST_LOGLINE_END