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

No signature of method: groovy.util.Node.div()... error in configure block

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After upgrading to 1.56 the following code block started to throw errors

      				
      maven{
          mavenInstallation 'maven339'
          goals '-B -q dependency:resolve-plugins'
          configure { 
              it / injectBuildVariables << false 
          }
      }
      

      The error message is

      No signature of method: groovy.util.Node.div() 
      is applicable for argument types: (java.lang.Boolean) values: [true]
      
      Possible solutions: is(java.lang.Object), wait(), find(), any(), dump(), wait(long)}}

      I can use the method added in JENKINS-40636 but the error message looks weird – why can't I use the configure block now?

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          Unfortunately this kind of problem arises from time to time when introducing new methods with the same name as the corresponding XML element. I'm have no idea how this can be fixed.

          Background: it has type groovy.util.Node and Node.div() is called when using the / operator on it. And Groovy is looking for variant with a boolean argument because injectBuildVariables resolves to the injectBuildVariables boolean field in the outer block which delegates to MavenContext.

          Show
          daspilker Daniel Spilker added a comment - Unfortunately this kind of problem arises from time to time when introducing new methods with the same name as the corresponding XML element. I'm have no idea how this can be fixed. Background: it has type groovy.util.Node and Node.div() is called when using the / operator on it . And Groovy is looking for variant with a boolean argument because injectBuildVariables resolves to the injectBuildVariables boolean field in the outer block which delegates to MavenContext .
          Hide
          sag47 Sam Gleske added a comment -

          I solved this odd message by quoting the selector.  Example:

          maven{
              mavenInstallation 'maven339'
              goals '-B -q dependency:resolve-plugins'
              configure { 
                  it / 'injectBuildVariables' << false 
              }
          }
          
          Show
          sag47 Sam Gleske added a comment - I solved this odd message by quoting the selector.  Example: maven{ mavenInstallation 'maven339' goals '-B -q dependency:resolve-plugins' configure { it / 'injectBuildVariables' << false } }
          Hide
          anthonycgreen Anthony Green added a comment - - edited

          I managed a work around to the / being interpreted as a div() command..

          def removeJvmOptions =

          { node -> node.remove(node.get(jvmOptions)[0]) }
          Show
          anthonycgreen Anthony Green added a comment - - edited I managed a work around to the / being interpreted as a div() command.. def removeJvmOptions = { node -> node.remove(node.get(jvmOptions)[0]) }

            People

            • Assignee:
              Unassigned
              Reporter:
              jbochenski Jakub Bochenski
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: