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

ExportXMLWordPrintable

      We start by creating a class in the groovy script but we've also tried having another groovy script as well as create the class in Java.

      When we then declare create an object with the class "def sc = new SimpleClass("Nisse")" the workflow will exit with an error code.

      The part "echo "this is the end"" will not be executed.

      If I remove the def sc = new ... then the job will exit and all the echo commands will run.

      workflow.groovy
      class SimpleClass{
          
          def name = ""
          
          public SimpleClass(def name){
              this.name = name
          }    
          
          public def greet(){
              return "Hello " + this.name
          }
          
      }
      
      def sc = new SimpleClass("Nisse")
      
      echo sc.greet()
      node("linux || windows") {
          echo "enter node"
          ws("rb-sb-revision") {
              echo "Node + WS 1"
          }
          echo "exit WS"
      }
      echo "this is the end"
      

            Assignee:
            Kohsuke Kawaguchi
            Reporter:
            Marcus Jacobsson
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: