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

Implement SimpleBuildStep for Workflow Compatibility

    Details

    • Similar Issues:

      Description

      CheckStylePublisher should implement SimpleBuildStep to allow tighter workflow integration.

      // DOES NOT WORK 
      step([$class: 'CheckStylePublisher', pattern: '**/checkstyle-result.xml'])
      
      java.lang.UnsupportedOperationException: CheckStylePublisher as a interface jenkins.tasks.SimpleBuildStep could mean either hudson.plugins.jshint.CheckStylePublisher or hudson.plugins.checkstyle.CheckStylePublisher
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.coerce(DescribableHelper.java:226)
      	at org.jenkinsci.plugins.workflow.structs.DescribableHelper.buildArguments(DescribableHelper.java:185)
      	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)
      	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:112)
      	...
      	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

          Activity

          Hide
          teilo James Nord added a comment -

          Cyrille Le Clerc this works - that error says jenkins couldn't work out which Checkstyle publisher you wanted (why do you have 2 different plugins?)

          step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher', pattern: '**/checkstyle-result.xml'])

          Show
          teilo James Nord added a comment - Cyrille Le Clerc this works - that error says jenkins couldn't work out which Checkstyle publisher you wanted (why do you have 2 different plugins?) step( [$class: 'hudson.plugins.checkstyle.CheckStylePublisher', pattern: '**/checkstyle-result.xml'] )
          Hide
          cleclerc Cyrille Le Clerc added a comment -

          James Nord good catch, I'll fill an RFE for the snippet generator

          Show
          cleclerc Cyrille Le Clerc added a comment - James Nord good catch, I'll fill an RFE for the snippet generator
          Hide
          jglick Jesse Glick added a comment -

          If two plugins offer a build step with the same simple class name, you must use a fully-qualified class name in the script.

          Show
          jglick Jesse Glick added a comment - If two plugins offer a build step with the same simple class name, you must use a fully-qualified class name in the script.

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              cleclerc Cyrille Le Clerc
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: