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

postbuildscript doesnt work with job-dsl plugin after upgrading to 3.0.0

XMLWordPrintable

    • job-dsl-plugin 1.81

      After the upgrade my build breaks with a cryptic NullPointerException error:

       

      [PostBuildScript] - [INFO] Executing post build scripts.
      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at org.jenkinsci.plugins.postbuildscript.processor.Processor.processScriptFiles(Processor.java:110)
      at org.jenkinsci.plugins.postbuildscript.processor.Processor.processScripts(Processor.java:89)
      at org.jenkinsci.plugins.postbuildscript.processor.Processor.process(Processor.java:79)
      at org.jenkinsci.plugins.postbuildscript.processor.Processor.process(Processor.java:73)
      at org.jenkinsci.plugins.postbuildscript.PostBuildScript.perform(PostBuildScript.java:77)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
      at hudson.model.Build$BuildExecution.post2(Build.java:177)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
      at hudson.model.Run.execute(Run.java:1932)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      Build step 'Execute scripts' marked build as failure
      An attempt to send an e-mail to empty list of recipients, ignored.
      Notifying upstream projects of job completion
      Finished: FAILURE

       


       

      All I did was to upgrade the postbuildscript plugin only. My Job DSL configuration did not change at all:

       

      job.with {
      publishers {
      postBuildScripts {
      steps {
      shell(""" 

      echo 'Hello world'

      """.stripIndent())
      }
      onlyIfBuildSucceeds(false)
      }
      }
      }

       

      In the version 2.11.0, this Job DSL config produced the job output in image "correct-job-output.png", in 3.0.0 it produces the job output in image "broken-job-output.png".

       

            dheid Daniel Heid
            denar50 Edgar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: