Category "groovy"

Required context class hudson.FilePath is missing Perhaps you forgot to surround the code with a step that provides this, such as: node

When i load another groovy file in Jenkinsfile it show me following error. "Required context class hudson.FilePath is missing Perhaps you forgot to surround th

How to repair a business process in hybris using groovy?

I need to repair a business process so i have the OrderProcess but i don't know how to repair it using groovy. Any idea? import de.hybris.platform.core.model.or

Reuse object/property in different stages of a declerative pipeline in Jenkins

We create a new maven build: def rtMaven = Artifactory.newMavenBuild() Now we want to reuse this rtMaven in a different stage than the current one; like in t

ModelService does not remove the model in groovy script

I'm trying to remove a model from database using ModelService in my groovy script but it doesn't remove. import de.hybris.platform.core.model.order.OrderModel i

JAVA/MSSQL: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed

I have got a problem with database queries, when I try to run them from my groovy script. Sometimes, but very often, I've got an error: com.microsoft.sqlserve

How to pass command line argument to Gradle Kotlin DSL

Here's an example from Groovy that represents exactly what I would like to achieve: Command line: ./gradlew jib -PmyArg=hello build.gradle.kts task myTask

Jenkinsfile Declarative Pipeline defining dynamic env vars

I'm new to Jenkins pipeline; I'm defining a declarative syntax pipeline and I don't know if I can solve my problem, because I didn't find a solution. In this e

Jenkins groovy - How to retrieve tag from latest commit?

To fetch the latest commit from branchName, we run below code: treeMapData = git(branch: branchName, credentialsId: credential, url: "${gitLabServer}/${project

Why does the @Override annotation not work when building a Grails project?

I'm using the Grails 2.3.8 build system to build my Grails project (i.e., the default system built on top of Gant). When I annotate my methods with @java.lang.

How to add a JDBC driver to a Jenkins pipeline?

I want to create a database within a pipeline script to be used by the deployed app. But first I started testing the connection. I got this problem: java.sql.S

groovy jenkinsfile to read a json file before `step` starts

I'm using Jenkins, we want to read a json file to provide necessary details within the jenkins scripts such as IP as an example. Jenkinsfile def getSecrets(json

Active Choices Reactive Reference Parameter is not referring Boolean parameter in Jenkins

I'm using Jenkins for the release processes. In a freestyle project, I need to show 'To Mail Id' input box to get mail ids to send mail only when 'Send Mail' ch

Why can't Groovy find this program even though it's on my PATH?

tl;dr: Groovy cannot find a program (phantomjs, which is on my $PATH) when I attempt to execute the shell command from a class -- it's otherwise finds it just f

Jenkins does not recognize command sh?

I've been having a lot of trouble trying to get a Jenkinsfile to work. I've been trying to run this test script: #!/usr/bin/env groovy node { stage('Build

Gradle 6+ : compile groovy before kotlin

I'm working on a project combining groovy and kotlin. My Kotlin classes require objects from groovy part, how can i make gradle compile groovy before kotlin ?

Rule based number format - Indian currency

http://icu-project.org/apiref/icu4j/com/ibm/icu/text/RuleBasedNumberFormat.html Using the above class, def format = new RuleBasedNumberFormat(new Locale("en"

Calling Hibernate in background threads in grails

I am trying to create a specific type of background processing setup in a grails application. A fixed size thread pool exists only for the duration of the batc

Version increment using gradle task

I want to increase the version number of my project from 1.0.0. to 1.0.1 automatically whenever a new build is made through bash command. I only need to increas

How to read a properties files and use the values in project Gradle script?

I am working on a Gradle script where I need to read the local.properties file and use the values in the properties file in build.gradle. I am doing it in the b