Groovy

来自linux中国网wiki
跳到导航 跳到搜索

install

sudo apt install  groovy groovy-doc  #Groovy Version: 2.4.21 JVM: 11.0.8 Vendor: Debian OS: Linux

https://www.osradar.com/install-apache-groovy-ubuntu-debian/

usage

当然也可以直接创建.groovy文件用命令行直接运行。

Groovy 简明教程

hello world

emacs    e.groovy
class Example {
   static void main(String[] args) {
      // Using a simple println statement to print output to the console
      println('Hello World');
   }
}


groovy  e.groovy

Hello World

注释annotations

多行注释 

多行注释以/*开头,并且能在行的任何位置 。以/*开头,包括新的行,直到第一个*/结束都被认为是注释的部分。多行注释可以放于声明的开始或者声明的中间。

Groovy 注释

map

evan@myxps:~/tmp$ cat 2.groovy 
def  http=[:]
println http.size()
http['syn'] = 'helo'
println http['syn']
println http.size()

https://www.cnblogs.com/jyan/archive/2012/05/30/2526372.html


Groovy集合(map)

Groovy函数调用

Groovy函数调用


Groovy - 方法(Methods)

jenkins and groovy

Jenkins插件groovy-postbuild使用(一)-获取jenkins环境变量值和获取build结果

see also

Groovy 简明教程


Groovy 教程

Groovy 语言快速入门

Groovy简介与使用

为什么Groovy语言火不起来?

Groovy是什么?