html tool

2017年8月22日星期二

groovy

http://groovy-lang.org/download.html

[popexizhi: jenkins pipeline how to debug groovy 脚本呢? go了一下可以安装groovy 环境本机debug ,bela,try一下,很简单]

安装

This tool makes installing Groovy on any Bash platform (Mac OSX, Linux, Cygwin, Solaris or FreeBSD) very easy.
Simply open a new terminal and enter:
$ curl -s get.sdkman.io | bash
Follow the instructions on-screen to complete installation.
Open a new terminal or type the command:
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
Then install the latest stable Groovy:
$ sdk install groovy
After installation is complete and you've made it your default version, test it with:
$ groovy -version
That's all there is to it!

Debug

https://dzone.com/articles/how-to-debug-groovy-script-from-shell
Groovy is a scripting language, so it is possible to run Groovy code without compiling to Java byte code. The necessary condition is that Groovy is installed on your machine. Then, running a Groovy script in a shell looks like the following line:
~>groovy TestScript.groovy
Now, something is wrong with the script on a special environment. You want to debug your Groovy script from the shell.
Fortunately, it works for Groovy just like for Java. You only have to export the Java options for debugging:
~>export JAVA_OPTS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=y"
Now, we can debug our script running from the shell with our favorite IDE.
~>groovy TestScript.groovy
Listening for transport dt_socket at address: 4000

没有评论:

发表评论