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

ExportXMLWordPrintable

      Defining a shared library with this structure:

       +- src
       |   +- org
       |       +- foo
       |           +- Bar.groovy  # for org.foo.Bar class
       +- vars
       |   +- execEcho.groovy
      

      Where Bar.groovy is:

      class Bar {
          def steps
      
          Bar(steps) { this.steps = steps)
      
          def doEcho(message) { steps.execEcho message }
      }
      

      and execEcho.groovy is

      def call(message) {
        echo message
      }
      

      Using this code within a pipeline

      ...
      def bar = new Bar(steps)
      bar.doEcho("Hello World!")
      ...
      

      Fails with:

      java.lang.NoSuchMethodError: No such DSL method 'execEcho' found among steps [...] or symbols [..., execEcho, ...]
      

      Even though execEcho shows up as one of the symbols

            Assignee:
            Unassigned
            Reporter:
            Ricardo Reis
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: