Hi everyone,

my Jenkins Pipeline prints the following message:
expected to call java.util.LinkedHashMap.action but wound up catching 
org.jenkinsci.plugins.workflow.cps.CpsClosure2.call

The Jenkinsfile is
pipeline {
  agent { label "Linux-Agent" }
  stages {
    stage("Stage") {
      steps {
        someStep(
          action: { sh "echo FOO" }
        )
      }
    }
  }
}

This ist he custom step 'someStep.groovy':
def call(additionalActions) {
  if (additionalActions.action) additionalActions.action()
}

Console output:
Running on Linux-Test (rdev40v59) in 
/data/jenkins-agent/workspace/Jenkins-Shared-Libs/testjob
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Stage)
expected to call java.util.LinkedHashMap.action but wound up catching 
org.jenkinsci.plugins.workflow.cps.CpsClosure2.call; see: 
https://jenkins.io/redirect/pipeline-cps-method-mismatches/
[Pipeline] sh
+ echo FOO
FOO
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

I have read https://jenkins.io/redirect/pipeline-cps-method-mismatches/, but 
can't figure out, why this error message occurs in my case.
Can anyone help me to find a solution?

Best regards
Stefan


-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8bd802501e9543efbe44d36fbd8fbff1%40tk.de.

Reply via email to