Top "Groovy" questions

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

Groovy - Convert object to JSON string

I'm pretty used to Grails converters, where you can convert any object to a JSON representation just like this (http://…

json groovy
Is there a null-coalescing (Elvis) operator or safe navigation operator in javascript?

I'll explain by example: Elvis Operator (?: ) The "Elvis operator" is a shortening of Java's ternary operator. One instance of where …

javascript jquery groovy safe-navigation-operator
groovy: safely find a key in a map and return its value

I want to find a specific key in a given map. If the key is found, I then want to …

dictionary groovy closures
How to check if a directory containing a file exist?

I am using groovy to create a file like "../A/B/file.txt". To do this, I have created a …

groovy
How to set and reference a variable in a Jenkinsfile

I have a declarative pipeline script for my multibranch project in which I would like to read a text file …

jenkins groovy jenkins-plugins jenkins-pipeline multibranch-pipeline
How to pass boolean parameter value in pipeline to downstream jobs?

I'm using Jenkins v2.1 with the integrated delivery pipeline feature (https://jenkins.io/solutions/pipeline/) to orchestrate two existing builds (…

jenkins groovy jenkins-pipeline
Groovy method with optional parameters

I would like to write a wrapper method for a webservice, the service accepts 2 mandatory and 3 optional parameters. To have …

groovy syntax optional-parameters
Run bash command on jenkins pipeline

Inside a groovy script (for a jenkins pipeline): How can I run a bash command instead of a sh command? …

linux bash shell jenkins groovy
Found shared references to a collection org.hibernate.HibernateException

I got this error message: error: Found shared references to a collection: Person.relatedPersons When I tried to execute addToRelatedPersons(…

java hibernate grails groovy gorm
Jenkins pipeline how to change to another folder

Currently i am using Jenkins pipeline script. For running one command, I need to access a folder outside its workspace …

jenkins groovy jenkins-pipeline