groovyshell Questions

5

Solved

What is the code to get the current date and time in groovy? I've looked around and can't find an easy way to do this. Essentially I'm looking for linux equivalent of date I have : import java.te...
Alkyd asked 7/9, 2016 at 1:44

2

Solved

When I run the below Jenkins pipeline script: def some_var = "some value" def pr() { def another_var = "another " + some_var echo "${another_var}" } pipeline { agent any stages { stage ("R...
Dejection asked 28/5, 2018 at 17:44

9

Solved

I tried to open the Groovy Shell (groovysh) on Windows 8 and got the following output: java.util.prefs.WindowsPreferences <init> WARNING: Could not open/create prefs root node Software\JavaS...
Metaprotein asked 7/5, 2013 at 20:35

1

This feels ridiculous that I have to ask this, but I can't seem to add multiple jar files to the classpath for groovyConsole and groovysh. How do I add multiple jar files to the classpath? Here is ...
Tidings asked 6/10, 2014 at 2:15

4

Solved

Hello i am a beginner to groovy i am cofused how to check whether the given input is a number or not i tried the following def a= ' 12.571245ERROR' if(a.isNan()==0) { println("not a number") } el...
Chiro asked 10/8, 2013 at 9:59

1

Solved

I want to curl an URL and capture the response into a variable. when I curl a command and echo its output I get the correct response as below sh 'output=`curl https://some-host/some-service/getAp...
Underscore asked 24/7, 2018 at 7:34

2

I am trying to implement following in GROOVY script but getting errors: Read contents of an HTML file in an array and then grep for something in that array. def file1 = new File("/path/to/the/file...
Keelia asked 23/5, 2017 at 11:10

3

Solved

I have just started learning groovy and I am reading "Groovy in Action". In this book I came across a statement that it doesn’t matter whether you declare or cast a variable to be of type int or In...
Representational asked 9/9, 2016 at 11:56

1

Solved

I've added the ability to parse and evaluate groovy scripts inside my java application using GroovyShell. Which maven artifact is the bare minimum to include in my build? I know that the groovy-al...
Scion asked 12/7, 2013 at 13:1

3

Solved

I run groovysh, and type the following code: groovy:000> String s = "Hello" ===> Hello groovy:000> s ERROR groovy.lang.MissingPropertyException: No such property: s for class: groovysh_ev...
Hern asked 20/8, 2011 at 7:51

1

I load the following script into groovysh: def a() { println "a()" } def b() { println "b()" a() } by using :load 'test.groovy' and call method b(): b() I get: groovy:000> b() b() No ...
Peignoir asked 28/7, 2015 at 14:49

1

My situation I call multiple Groovy scripts from Java, they both contain long-lived Groovy objects. I would like my Groovy scripts to make some changes to a Java meta-class for a Java class (that...
Astray asked 18/5, 2015 at 22:33

2

Solved

I need to retrieve at runtime the full path of the script file in Groovy 2.3. Actually I have the same problem than the one described here: get path to groovy source file at runtime. My script can...
Tenor asked 7/10, 2014 at 16:15

2

Solved

Java: public final class Outer { public static void main(String[] args) { Inner.inner(); } private static final class Inner { private static void inner() { System.out.println("inner"); out...
Bespangle asked 30/10, 2014 at 17:28

4

Solved

In order to get my setup a bit closer to "one click deployment", I would like to use groovy scripts to start/stop other processes controlled by bat scripts, running in different parts of the filesy...
Varick asked 26/8, 2009 at 12:21

1

I could not see any method to remove a variable from memory in Groovy shell... is this possible? How do I do this? I can see methods for doings this in Beanshell and Javascript(Rhino) but not in Gr...
Alate asked 29/5, 2012 at 10:53

1

Solved

I'm very new to Groovy. How can I list all variables I passed to Binding constructor ? Considering I have following : @Test public void test() { List<String> outputNames = Arrays.asList("...
Yehudit asked 14/9, 2011 at 19:36

3

Solved

I'm using GroovyShell as an "expression evaluator/engine" inside my program. It accepts two inputs: (a) one or more init scripts (b) user-defined script. Both are then concatenated at runtime as bi...
Theorbo asked 16/3, 2011 at 9:16

3

Solved

I'm a grails newbie (and a groovy newbie), and I'm working through some grails tutorials. As a new user, the grails shell is a really useful little tool for me, but I can't figure out how to make i...
Hallucinatory asked 11/1, 2010 at 5:19
1

© 2022 - 2024 — McMap. All rights reserved.