Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29891

ClassCastException in Workflow and Copy Artifact plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • Jenkins 1.609.1
      Java8
      workflow 1.9
      copy artifact 1.35.2

      use the snippet generator to create a copy artifact step using the General Build Step.

      step([$class: 'CopyArtifact', filter: '*.war', fingerprintArtifacts: true, projectName: 'war', selector: [$class: 'StatusBuildSelector', stable: false]])
      

      add this to a simple workflow and run it.

      result -> workflow fails with exception

      java.lang.ClassCastException: org.jenkinsci.plugins.workflow.steps.CoreStep.delegate expects interface jenkins.tasks.SimpleBuildStep but received class java.lang.String
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:250)
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:186)
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.instantiate(DescribableHelper.java:91)
      	at org.jenkinsci.plugins.workflow.steps.StepDescriptor.newInstance(StepDescriptor.java:103)
      	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:133)
      

            jglick Jesse Glick
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: