“Groovy”的版本间的差异
跳到导航
跳到搜索
(→usage) |
(→map) |
||
(未显示同一用户的15个中间版本) | |||
第1行: | 第1行: | ||
− | [[category:ops]] | + | [[category:ops]] [[category:devops]] |
− | = | + | =install= |
sudo apt install groovy groovy-doc #Groovy Version: 2.4.21 JVM: 11.0.8 Vendor: Debian OS: Linux | sudo apt install groovy groovy-doc #Groovy Version: 2.4.21 JVM: 11.0.8 Vendor: Debian OS: Linux | ||
第7行: | 第7行: | ||
=usage= | =usage= | ||
当然也可以直接创建.groovy文件用命令行直接运行。 | 当然也可以直接创建.groovy文件用命令行直接运行。 | ||
+ | |||
+ | [https://www.qikqiak.com/post/groovy-simple-tutorial/ Groovy 简明教程] | ||
==hello world== | ==hello world== | ||
<pre> | <pre> | ||
第22行: | 第24行: | ||
Hello World</pre> | Hello World</pre> | ||
+ | ==注释annotations== | ||
+ | 多行注释 | ||
+ | |||
+ | 多行注释以/*开头,并且能在行的任何位置 。以/*开头,包括新的行,直到第一个*/结束都被认为是注释的部分。多行注释可以放于声明的开始或者声明的中间。 | ||
+ | |||
+ | [https://www.w3cschool.cn/groovy/groovy_annotations.html Groovy 注释] | ||
+ | |||
+ | ==map== | ||
+ | <pre> | ||
+ | evan@myxps:~/tmp$ cat 2.groovy | ||
+ | def http=[:] | ||
+ | println http.size() | ||
+ | http['syn'] = 'helo' | ||
+ | println http['syn'] | ||
+ | println http.size() | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | https://www.cnblogs.com/jyan/archive/2012/05/30/2526372.html | ||
+ | |||
+ | |||
+ | [https://blog.csdn.net/dora_310/article/details/52877750 Groovy集合(map)] | ||
+ | |||
+ | ==Groovy函数调用 == | ||
+ | |||
+ | [https://blog.csdn.net/qfanmingyiq/article/details/106028568 Groovy函数调用] | ||
+ | |||
+ | |||
+ | [https://iowiki.com/groovy/groovy_methods.html Groovy - 方法(Methods)] | ||
+ | |||
+ | =jenkins and groovy = | ||
+ | |||
+ | [https://blog.csdn.net/gzh8579/article/details/59522469 Jenkins插件groovy-postbuild使用(一)-获取jenkins环境变量值和获取build结果] | ||
=see also= | =see also= | ||
+ | [https://www.qikqiak.com/post/groovy-simple-tutorial/ Groovy 简明教程] | ||
+ | |||
+ | |||
+ | [https://www.w3cschool.cn/groovy/ Groovy 教程] | ||
+ | |||
+ | [https://www.jianshu.com/p/e8dec95c4326 Groovy 语言快速入门] | ||
+ | |||
+ | [https://www.jianshu.com/p/2c6b95097b2c Groovy简介与使用] | ||
+ | |||
[https://www.zhihu.com/question/22870020 为什么Groovy语言火不起来?] | [https://www.zhihu.com/question/22870020 为什么Groovy语言火不起来?] | ||
+ | |||
+ | [https://blog.csdn.net/cyh1111/article/details/4128062 Groovy是什么?] |
2022年8月5日 (五) 02:40的最新版本
目录
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文件用命令行直接运行。
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
多行注释
多行注释以/*开头,并且能在行的任何位置 。以/*开头,包括新的行,直到第一个*/结束都被认为是注释的部分。多行注释可以放于声明的开始或者声明的中间。
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函数调用
jenkins and groovy
Jenkins插件groovy-postbuild使用(一)-获取jenkins环境变量值和获取build结果