Folder icon

Tags / Groovy

Using sed in Jenkins Groovy pipeline

I spent some time trying to figure out how to fix unexpected slash char error in my pipeline. My aim was to change some value in a config file after checking out a Git repository. I have a Jenkins pipeline and I used sed to perform the substitution. The pipeline wouldn't even compile because of Groovy's way of…
Posted on

How to run a Groovy script from Java


Uncaught exception: the image is currently being shown in a museum

One of the ways of running a Groovy script from Java is using GroovieShell. First, add the groovy-all Maven dependency (consider using a fresher version): Next, create a class containing the main method. The Binding instance helps us to bind variables to the shell. These variables will be available for our script. We…
Posted on