Questions tagged [groovy]

Groovy is an object-oriented programming language for the Java platform. It is a dynamic language with features similar to those of Python, Ruby, Perl and Smalltalk. It can be used as a scripting language for the Java platform.

Filter by
Sorted by
Tagged with
0 votes
0 answers
20 views

Stage appears as success immediately, even though it's still running in Jenkins declarative parallel job [duplicate]

I've got parallel Jenkins stages in a declarative pipeline pipeline { agent any stages { stage('parallel') { parallel { stage('one') { ...
Michal Charemza's user avatar
-1 votes
1 answer
68 views

AES Encrypt in groovy, decrypt in c#

I need to encrypt a small string of text using a pre-shared key using Groovy and AES. The system on the other side needs to decrypt using C# and cannot be changed (at all). It is using the class ...
chris's user avatar
  • 81
0 votes
1 answer
27 views

Groovy SQL eachRow requires ResultSet to be returned

Groovy's SQL provides an eachRow() method but it seems to generate an uncatchable error if the SQL statement being executed doesn't produce a ResultSet, e.g. an INSERT statement. Of course Groovy SQL ...
H. Dog's user avatar
  • 191
0 votes
0 answers
20 views

Compile Only implmentation of external lib is still required in end app

I have an external library that wraps some implementations of a third party library that we want to make interchangeable when I bring the features the third party does in-house. This is then published ...
BilalMH's user avatar
  • 175
0 votes
1 answer
41 views

How to Use CollectEntries in Groovy to create a map that has multiple values for each key

I have the following List of Lists. It is in the format of [String, Double] def data = [ ['A', 15.2], ['A', 14.7], ['B', 6.54], ['A', 4.5], ['A', 16.8], ['A', 7.7], ['C', 1.5], ['B', 13.1], ['B', 6], [...
snbmt21's user avatar
0 votes
0 answers
46 views

How to Go About Limiting Memory Usage, Java's Groovy Executor

In using the Groovy executor for Java, I need to limit the script execution time and the memory size of the variables in the groovy objects. Here is my part code,The groovy object here is groovy.lang....
Fate's user avatar
  • 1
-3 votes
0 answers
64 views

Check if the length of string is less than 250 [closed]

Please check image for XML since I am getting an error when I try to put the code. In the above XML I want to validate that if telephoneNumber-->name contains 'Home' or 'Home Mobile' then the ...
Shashi's user avatar
  • 1
0 votes
1 answer
32 views

GPathResult field namesapceTagHints has type Map<String, String> but getClass() returns NodeChildren

I think I am going mad. I am using Groovy for handling xml files and wanted to write a little helper class to help myself get nodes by name in a typed way. While doing this I created a class extending ...
Skillzore's user avatar
  • 752
0 votes
0 answers
52 views

How to call getVersionFileName() from AWSCodeDeployPublisher plugin in Jenkins?

I'm running AWS CodeDeploy on Jenkins Pipeline using AWSCodeDeployPublisher plugin. This is a snippet which works just fine. stage('CodeDeploy') { step([ $class: 'AWSCodeDeployPublisher', ...
Vlad Stratulat's user avatar
0 votes
2 answers
45 views

Setting closure's delegate in method results in SO

I'm using the following code with builder: Closure getObject = { String oType -> return { type oType format 'int32' } } def yaml = new YamlBuilder() yaml{ string 'value' object1{ ...
injecteer's user avatar
  • 20.3k
0 votes
2 answers
30 views

How make worked array in Groovy (Scriptrunner) ? (jira/workflow/post-function)

Please tell me how I can make my code work with a Groovy array (scriptrunner) I wrote the code and it only works when getting a specific element (string) I've tried for the 100th time to make a loop, ...
Alex_Borovskii's user avatar
0 votes
0 answers
16 views

Unable to do operation on running pipeline's log

Running sonar scan to scan the build. Scanning working fine but want to check Sonar way profile got used to scan the project, if not then pass the pipeline with warning message. I thought to get the ...
rajeev singh's user avatar
0 votes
1 answer
46 views

Maven - run java and groovy tests

When running mvn test Only java tests are run I want to learn how to run all tests without IDE Output (important part) [INFO] --- gmavenplus-plugin:3.0.0:addTestSources (default) @ project --- [INFO] ...
Rustacean's user avatar
0 votes
0 answers
63 views

Problem with Method reference operator and CompileStatic

In the following code, @CompileStatic does not work in combination with the method reference operator for Groovy methods collect and find, although it works with Java streams or the method pointer ...
IWilms's user avatar
  • 500
0 votes
1 answer
41 views

unable to resolve class groovy.yaml.YamlSlurper in Nifi

Using Nifi 1.23.2 I'm not able to resolve the YamlSlurper class in a ExecuteScript processor (Groovy 3.0.17) nor in the ExecuteGroovyScript processor (Groovy 3.0.18). With a minimal script body like ...
GBC's user avatar
  • 37
1 vote
2 answers
44 views

Converting CSV to hashmap - groovy scripting jmeter

I already created a dynamic xml request payload and I'm pulling some data from CSV file. Now im having a hardtime to convert csv rows and column to hashmap since im a bit new to Groovy scripting. My ...
Ibivio R's user avatar
0 votes
1 answer
38 views

Issues building Android gradle project: Task :buildSrc:compileGroovy FAILED

I am trying to build an Android SDK on my Windows machine. I upgraded my Java to latest 64-bit JDK (21) and when running .\gradlew.bat core:assembleCoreDebug, I get these errors. How to resolve it? ...
Mary's user avatar
  • 161
0 votes
0 answers
27 views

Disable logging of Jenkins functions in Jenkins Blue Ocean

When using the Jenkins functions readJSON and httpRequest in my groovy file for a Jenkins pipeline step, this gets shown as a row in Jenkins Blue. Is there any way to disable the logging of these ...
GSerum_'s user avatar
  • 57
0 votes
1 answer
29 views

How to get failure causes of current build in Jenkins using Python?

I want to implement currentbuild.rawbuild.getcauses() in Python. How can I do that? The functn is presently a part of groovy script which needs to be converted to Python. I don't seem to find anything ...
Shivani's user avatar
0 votes
1 answer
51 views

In Gradle Kotlin, how to iterate like each{} in Groovy?

In the Android doc, there's a build.gradle snippet describing the set up for com.google.protobuf: protobuf { protoc { artifact = "com.google.protobuf:protoc" } ...
FishBone000's user avatar
0 votes
1 answer
31 views

How to concatenate elements of list in a new line in flat file in Groovy script

I am trying to get all the values from following xml into one string splitted by "|" <n0:SendData xmlns:n0="http://testdata/" xmlns:soap-env="http://...
user22946701's user avatar
-1 votes
0 answers
18 views

Flutter::: Unresolved reference: `groovy-gradle-plugin Error Line 6

Launching lib\main.dart on V2149 in debug mode... e: E:\my Project\flutter\packages\flutter_tools\gradle\build.gradle.kts:6:5: Unresolved reference: groovy-gradle-plugin FAILURE: Build failed with an ...
user22944154's user avatar
0 votes
1 answer
20 views

How to print picocli usage before every execution

Is there a way to show picocli usage everytime even if the mandatory options/parameters requirements are fulfilled, either through some inbuilt option or custom configuration. I would wish for an ...
Asif Kamran Malick's user avatar
-1 votes
0 answers
32 views

Modifying multiple Jenkins files with context-aware changes

I need to modify tens of Jenkins files altering similar lines in each file. But context should be taken into account. The goal is to migrate from old function calls format to new ones and add ...
Pavel Soloviev's user avatar
0 votes
2 answers
75 views

How to access current build variant in gradle.properties?

I need to access the current build variant in gradle properties whenever I change the build variant through the Android Studio interface. Is there any way to access that value? The problem: So I have ...
jane's user avatar
  • 104
0 votes
0 answers
46 views

Test case in groovy failing while migrating from java 11 to 17

I am getting this error when I am updating java version from 11 to 17. SpecInternals.SpyImpl:168->SpecInternals.createMockImpl:295->SpecInternals.createMockImpl:305- >SpecInternals....
Ridhi Bhat's user avatar
0 votes
0 answers
22 views

Ho to show/hide buttons and table controllers based on conditions set in the groovy script in SAP Advanced Workflow

I'm using the following code in my groovy script to hide or show a button and a table controller in the form. But this is not working and not making any difference in the show/hide of the screen ...
Debabrata Mukherjee's user avatar
0 votes
1 answer
61 views

Spring boot gradle integration test with Spock

I am using Spring Boot + Gradle + Spock (groovy) for integration and unit testing. I was able to configure unit tests to work with Spock. Integration tests fail to start because they do not see ...
Evgenii's user avatar
  • 447
0 votes
1 answer
24 views

How to read which pipelines a user is allowed to run as downstream jobs in Jenkins

I want to add a feature in my groovy script to allow users run other jobs sequencially once the job they have selected has finished if they input the name of the job in a text field created for such ...
Alex's user avatar
  • 975
0 votes
0 answers
31 views

SoapUI requests and responses to text file using groovy

How can I save my REST project in SoapUI Open Source all requests and responses that was ran to a text file divided in sections test by test. I would like to use a Groovy code to do it, Please may ...
Mayanna's user avatar
1 vote
1 answer
58 views

How to mock bean in springboot groovy and spock tests?

This is a spock test using groovy This is my code @SpringBootTest class SrMetricServiceAspectTest extends Specification { @Autowired @Qualifier("potentialSrCreation") private ...
committedandroider's user avatar
1 vote
1 answer
31 views

Attribute 'requiredOptionMarker' should have type 'java.lang.Character'; but found type 'java.lang.String'

Running Script FAILS with Groovy 3.0.19 but PASSES with Groovy 4.0.15 I'm trying to follow picocli documentation instructions specific to groovy scripts : Section 30.1.2. Groovy Scripts There is a ...
Asif Kamran Malick's user avatar
0 votes
0 answers
14 views

How to navigate to a new screen on a button click in SAP Advanced Workflow

I'm new to SAP Advanced Workflow. I'm developing an application in which I have created a form using the form designer. In that form there needs to be a button on the click of which it should load a ...
Debabrata Mukherjee's user avatar
0 votes
2 answers
57 views

Why does my test not work when splitting mocking and stubbing?

I struggle with Spock/Groovy testing. Don't know why but in WHEN section, I cannot check number of calls and checking the value at once.. If I check one of them separatly all works fine! This test ...
michalbarnat's user avatar
0 votes
1 answer
35 views

How to use Groovy's TableLayout valign attribute

The TableLayou in Groovy's SwingBuilder package supports vertical alignment. But it seems to have no effect when I use it in my code import groovy.swing.SwingBuilder; import javax.swing.BorderFactory; ...
Vlad's user avatar
  • 13
0 votes
1 answer
35 views

Groovy script to write XML data to xls(Excel)

I have a XML structure like below. How to write a groovy script to write XML data to xls(Excel)? Could someone help me on this? <Record> <Action>create</Action> <ID KEMASAN>...
user6927606's user avatar
-1 votes
1 answer
34 views

Upload large(mb) files from jenkins GUI to respective build workspace

I have a scenario where i need to upload large (mb’s) file from Jenkins GUI to workspace? Is there a way to achieve this request? Please let me know the available solutions. File should get uploaded ...
Butterfly88's user avatar
0 votes
0 answers
26 views

Jenkins pipeline calling multiconfig project and setting description

I have a jenkins pipeline that calls a groovy script. Within that script I have a step that runs a jenkins multi-configuration job on 4 different agents. I've using the jenkins description setter ...
user2968674's user avatar
0 votes
1 answer
36 views

Substitute variables in a String read from a file using Groovy

New to groovy as part of upskilling, please help. I have a text file with content below: Name is $vName City is $vCity I read this file as follows. def vName="John" def vCity="NewYork&...
asjadazeez's user avatar
0 votes
1 answer
27 views

Groovy: Convert Zip content bytes to string

I have these 2 classes: Message class MessageLog class The first class Message, has a method getBody which can return an object that we can specify (as in the documentation), and the second class ...
Suwandi Cahyadi's user avatar
0 votes
0 answers
21 views

Access variable from another gradle task

I have 2 task , I want to access variable from dependent task, But its giving null value task test1(type: Exec) { doFirst { def serviceUrl = "dummyUrl" rootProject.ext["...
niranjan pb's user avatar
  • 1,125
0 votes
0 answers
25 views

Why groovy Script behaves differently?

I'm new to groovy, so sorry if its an obvious question Consider the following: have two files, Main.groovy and script.groovy Main.groovy: package org.example static void main(String[] args) { def ...
Etheilred's user avatar
0 votes
0 answers
26 views

Use a changeset condition with if

Can we use a changeset condition with if in Jenkins if (changeset "**/ml/docker/Dockerfile-dataproc-pp") { echo "Pushing all docker images with all tags to GCR" } When I ...
Tom J Muthirenthi's user avatar
0 votes
0 answers
19 views

How can parameters be passed between tabs in a tab container in SAP Advanced Workflow

I'm new to SAP workflow. I'm using a tab container in my form. I need to pass values across the tabs in it such that when Next/save button is clicked it will pass to the next tab in the container. I ...
Debabrata Mukherjee's user avatar
0 votes
0 answers
6 views

How do I set the status of a Script Assertion in SoapUI?

After looking at this documentation, GroovyScriptAssertion (SoapUI 3.0.0 API) (smartbear.com), I've tried the following def currentStep = context.getCurrentStep(); def assertion = currentStep....
rozza's user avatar
  • 936
0 votes
1 answer
28 views

Converting a String to a String[] yields different results when used in variable definition or as function parameters

I am trying to implement a small function in Groovy, taking a array of String as an input and printing it in a YAML format. It seems Groovy is converting String variables to String[] in different ways ...
X. Poirot's user avatar
0 votes
1 answer
39 views

Jmeter - Selenium/WebDriver : unable to resolve class org.openqa.selenium.support.ui

os Ubuntu 20.04.6 java --version openjdk 17.0.8.1 2023-08-24 Jmeter v 5.6.2 Selenium/WebDriver Support 4.13.0.0 groovy script import org.openqa.selenium.support.ui as ui; WDS.sampleResult.sampleStart(...
vyom's user avatar
  • 3
0 votes
0 answers
32 views

How to get the values from different node in XML using XSLT mapping with condition

I've got an xml similar to this: Input XML I need to get the Manager details (company , cost_center) if the Person ../company = 001 So, basically it should be the output like that: Required XML I knew ...
vamsi krishna's user avatar
0 votes
1 answer
21 views

Workaround if import is not known in execution environment, but that type is needed as parameter

I have this line in Groovy: organizationsQuery = organizationService.newOrganizationsQueryBuilder().serviceDeskId().pagedRequest(new SimplePagedRequest(startRequest,50)).build() Since in the execution ...
mibemerami's user avatar
0 votes
1 answer
30 views

How to fetch the build parameters of a job that is in running state?

I want to fetch the build parameters from the latest build of a job, even if the latest build is still building. def buildParameter = currentJob.getAction(ParametersAction.class) paramValue = ...
Juveria Iram's user avatar

1
2 3 4 5
601