Jenkins Job DSL Plugin fails on boolean inputs to job parameters

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The Jenkins job dsl plugin is failing to let me send in boolean values to some of the types permitted.

      For instance, with a job DSL plugin as follows:
      job ( type: Maven ) {
      snapshotDependencies(true)
      }

      Comes back with an error as follows:
      Building in workspace /var/lib/jenkins/jobs/ii-product-branch-dsl-job/workspace
      FATAL: No signature of method: script14031065985881688050943.Boolean() is applicable for argument types: (java.lang.String) values: [false]
      Possible solutions: asBoolean(), collect(), collect(groovy.lang.Closure)
      groovy.lang.MissingMethodException: No signature of method: script14031065985881688050943.Boolean() is applicable for argument types: (java.lang.String) values: [false]
      Possible solutions: asBoolean(), collect(), collect(groovy.lang.Closure)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:78)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
      at script14031065985881688050943.run(script14031065985881688050943.groovy:20)
      at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:69)
      at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:93)
      at javaposse.jobdsl.plugin.ExecuteDslScripts.perform(ExecuteDslScripts.java:159)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
      at hudson.model.Run.execute(Run.java:1732)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:234)

      The Wiki reference shows the usage as:
      snapshotDependencies(boolean checkSnapshotDependencies)

      I have tried many variations to send in boolean values, such as casting asBoolean() and importing static java.lang.Boolean.TRUE as a type etc.

      Either I am missing something, or there is a bug with this.

            Assignee:
            Daniel Spilker
            Reporter:
            Adam K
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: