Top "Groovy" questions

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

How to encode URL in Groovy?

Is there a kind of URLEncode in Groovy? I can't find any String → String URL encoding utility. Example: dehydrogenase (NADP+) → …

groovy urlencode url-encoding
Jenkins Pipeline NotSerializableException: groovy.json.internal.LazyMap

Solved: Thanks to below answer from S.Richmond. I needed to unset all stored maps of the groovy.json.internal.…

json jenkins groovy jenkins-pipeline
What is the effect of @NonCPS in a Jenkins pipeline script

I have a pipeline script in Jenkins. I used to get this exception: org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts …

jenkins groovy
Jenkins: Pipeline sh bad substitution error

A step in my pipeline uploads a .tar to an artifactory server. I am getting a Bad substitution error when …

bash jenkins groovy jenkins-pipeline
Read interactive input in Jenkins pipeline to a variable

In a Jenkins pipeline, i want to provide an option to the user to give an interactive input at run …

jenkins groovy jenkins-pipeline jenkins-2
Elegant way for do ... while in groovy

How to do code something like this in groovy? do { x.doIt() } while (!x.isFinished()) Because there is no do ... …

loops groovy do-while
How to send Slack notification after Jenkins pipeline build failed?

I have a pipeline groovy script in Jenkins v2.19. Also I have a "Slack Notification Plugin" v2.0.1 and "Groovy Postbuild …

jenkins groovy jenkins-pipeline slack
How can I reference the Jenkinsfile directory, with Pipeline?

I have a groovy file, I want to run from the Jenkinsfile. ie. load script.groovy However, I am not …

jenkins groovy jenkins-workflow jenkins-pipeline jenkinsfile
How to create methods in Jenkins Declarative pipeline?

In Jenkins scripted pipeline we are able to create methods and can call them. Is it possible also in the …

jenkins groovy jenkins-pipeline jenkins-groovy jenkins-declarative-pipeline
How can I use the Jenkins Copy Artifacts Plugin from within the pipelines (jenkinsfile)?

I am trying to find an example of using the Jenkins Copy Artifacts Plugin from within Jenkins pipelines (workflows). Can …

groovy jenkins-workflow jenkinsfile