- Home
- Interview Questions
- DevOps
The Java plugin adds Java compilation along with testing and bundling capabilities to theproject. It is introduced in the way of a SourceSet which act as a group of source filescomplied and executed together.
Apache Groovy is a object-oriented programming language for the Java platform.
It is both a static and dynamic language with features similar to those of Python, Ruby, Perl,and Smalltalk.
It can be used as both a programming language and a scripting language for the JavaPlatform, is compiled to Java virtual machine (JVM) bytecode, and interoperatesseamlessly with other Java code and libraries.
Groovy uses a curly-bracket syntax similar to Java. Groovy supports closures, multilinestrings, and expressions embedded in strings.
And much of Groovy's power lies in its ASTtransformations, triggered through annotations.
Groovy adds the execute method to String to make executing shells fairly easyprintln "ls".execute().text
These are the infrastructure components where we can use groovy:
-Application Servers
-Servlet Containers
-Databases with JDBC drivers
-All other Java-based platforms
Through this class programmers can add properties, constructors, methods and operationsin the task. It is a powerful option available in the Groovy.By default this class cannot be inherited and users need to call explicitly. The command forthis is “ExpandoMetaClass.enableGlobally()”.