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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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) 

       

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: 15knots
          Path:
          src/main/java/hudson/plugins/cmake/CmakeBuilder.java
          http://jenkins-ci.org/commit/cmakebuilder-plugin/9a83889769e1f93b2916deaa80771ca501bdd163
          Log:
          fix JENKINS-43175 NPE at hudson.plugins.cmake.CmakeBuilder.perform

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: 15knots Path: src/main/java/hudson/plugins/cmake/CmakeBuilder.java http://jenkins-ci.org/commit/cmakebuilder-plugin/9a83889769e1f93b2916deaa80771ca501bdd163 Log: fix JENKINS-43175 NPE at hudson.plugins.cmake.CmakeBuilder.perform
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: 15knots
          Path:
          src/test/java/hudson/plugins/cmake/CmakeBuilderBuildTest.java
          http://jenkins-ci.org/commit/cmakebuilder-plugin/dc0488e3b4004ac363f86f45271a9feaa225b448
          Log:
          JENKINS-43175: adjusted unit tests

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: 15knots Path: src/test/java/hudson/plugins/cmake/CmakeBuilderBuildTest.java http://jenkins-ci.org/commit/cmakebuilder-plugin/dc0488e3b4004ac363f86f45271a9feaa225b448 Log: JENKINS-43175 : adjusted unit tests

            People

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

              Dates

              • Created:
                Updated:
                Resolved: