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

ExportXMLWordPrintable

      I have developed groovy classes in IntelliJ IDE, I want to instantiate one of these classes in 'Pipeline script' of Pipeline plugin in Jenkins. I tried to follow the examples of 'Eval.me' and class.forName

      Sample
      
      package com.mycomp.tmo
      
      /**
       * Created by
       */
      public void callMe(){
          println("Hello World !")
      }
      
      
      def e = "callMe"
      def cl = Class.forName("com.mycomp.tmo.Sample")
      println(Eval.me("${c1} (${e})"))
      

      Tried Below as well:

      String cls = 'D:\\Users\\b\\IdeaProjects\\Automation\\src\\com\\mycomp\\tmo\\DBConnectionManager'
      
      def map = ['person': ${cls}]
      map['person'].newInstance()
      
      String cls = 'D:\\Users\\b\\IdeaProjects\\Automation\\src\\com\\mycomp\\tmo\\DBConnectionManager'
      
      def map = ['person': ${cls}]
      map['person'].newInstance()
      

            Assignee:
            Jesse Glick
            Reporter:
            Pedda Reddy
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: