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

java.lang.NullPointerException at hudson.plugins.cmake.CmakeBuilder.perform(CmakeBuilder.java:265)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • cmakebuilder-plugin
    • None
    • Windows 7

      After creating a DSL job using the following closure:

      cmake

      { cmakeInstallation('InSearchPath') generator('Visual Studio 14 2015') sourceDir('control4') cleanBuild() buildDir('control4/build') }

      The resulting xml looks like so:

      <hudson.plugins.cmake.CmakeBuilder>
      <installationName>InSearchPath</installationName>
      <generator>Visual Studio 14 2015</generator>
      <cleanBuild>true</cleanBuild>
      <sourceDir>control4</sourceDir>
      <workingDir>control4/build</workingDir>
      <toolArgs>-DIGNORE_UNIT_TESTS=1</toolArgs>
      </hudson.plugins.cmake.CmakeBuilder>

      When I run the job in that configuration the exception reported is thrown. After changing the job (just saving it in the UI) the XML looks like so:

      <hudson.plugins.cmake.CmakeBuilder plugin="cmakebuilder@2.4.4">
      <installationName>InSearchPath</installationName>
      <workingDir>control4/build</workingDir>
      <toolArgs>-DIGNORE_UNIT_TESTS=1</toolArgs>
      <generator>Visual Studio 14 2015</generator>
      <sourceDir>control4</sourceDir>
      <cleanBuild>true</cleanBuild>
      <toolSteps/>
      </hudson.plugins.cmake.CmakeBuilder>

      And the job runs without complaint. I have no toolSteps defined, nor do I want any (it appears optional anyway).

      The empty toolSteps element must be set. I am now using the configure closure to work around the issue:

      configure {
      it / builders << 'hudson.plugins.cmake.CmakeBuilder' (plugin: 'cmakebuilder')

      { installationName('InSearchPath') workingDir('control4/build') generator('Visual Studio 14 2015') sourceDir('control4') cleanBuild('true') toolSteps() }

      }

      Here's the full stacktrace:

      00:00:20.364 java.lang.NullPointerException
      00:00:20.364 at hudson.plugins.cmake.CmakeBuilder.perform(CmakeBuilder.java:265)
      00:00:20.364 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      00:00:20.364 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      00:00:20.364 at hudson.model.Build$BuildExecution.build(Build.java:205)
      00:00:20.364 at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      00:00:20.365 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      00:00:20.365 at hudson.model.Run.execute(Run.java:1728)
      00:00:20.365 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      00:00:20.365 at hudson.model.ResourceController.execute(ResourceController.java:98)
      00:00:20.365 at hudson.model.Executor.run(Executor.java:404) 

       

            15knots Martin Weber
            fzbassman Eric Wallengren
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: