Top "Groovy" questions

Groovy is an object-oriented programming language for the Java platform.

How can I determine if a String is non-null and not only whitespace in Groovy?

Groovy adds the isAllWhitespace() method to Strings, which is great, but there doesn't seem to be a good way of …

string groovy whitespace
Groovy / grails how to determine a data type?

What is the best way to determine the data type in groovy? I'd like to format the output differently if …

groovy types
Jenkins pipeline if else not working

I am creating a sample jenkins pipeline, here is the code. pipeline { agent any stages { stage('test') { steps { sh 'echo …

jenkins groovy
Array of strings in groovy

In ruby, there is a indiom to create a array of strings like this: names = %w( lucas Fred Mary ) Is …

arrays string groovy
Groovy Shell warning "Could not open/create prefs root node ..."

I tried to open the Groovy Shell (groovysh) on Windows 8 and got the following output: java.util.prefs.WindowsPreferences <…

windows groovy groovyshell
Copy entire directory contents to another directory?

Method to copy entire directory contents to another directory in java or groovy?

java grails file-io groovy
How to list all `env` properties within jenkins pipeline job?

Given a jenkins 2.1 build pipeline, jenkins injects a env variable into the node{}. For example, BRANCH_NAME can be accessed …

jenkins groovy jenkins-pipeline
Groovy String to Date

I am coding this with Groovy I am currently trying to convert a string that I have to a date …

string parsing date groovy
Conditional step/stage in Jenkins pipeline

How do you run a build step/stage only if building a specific branch? For example, run a deployment step …

jenkins groovy jenkins-pipeline
How do I create and access the global variables in Groovy?

I need to store a value in a variable in one method and then I need to use that value …

groovy