How to define global variables in groovy file, which I want to load and consume?
try this one

static void main(String[] args) { 
      // Initializing 2 variables 
      def x = 5; 
      def y = 10;

      //Performing addition of 2 operands 
      println(x+y);
 }


}

check this URL