30,381 questions
0
votes
1
answer
23
views
Why did json views syntax change between Grails 4 and Grails 5?
While upgrading a Grails 4 application to Grails 5, I encountered a failure in one of the json views (.gson file) when specifying a field having an empty map. In Grails 4, this worked fine, but in ...
0
votes
0
answers
38
views
When and why should I use the "this" keyword in Groovy classes?
When should I use the keyword this with class variables? It is not needed but I can't find when I should use it, except for when a local variable uses the same name as a class variable.
With this:
...
0
votes
3
answers
24
views
Variable string in groovy's Eval.me()
I would like to use Eval.me to expand a string which contains a variable name.
def var = '1234'
// This works
eval_str = "println $var"
Eval.me(eval_str)
// This does not: No such property:...
1
vote
1
answer
30
views
How to send messages between agents on the same node in Unetstack
I have created two unetstack groovy agents (AnchorMotionAgentV2 and AnchorCommAgentV2), which I expect to send messages to each other. The AnchorCommAgentV2 is expected pass control messages to ...
0
votes
0
answers
21
views
How to replace a value in Groovy Array
characterList:[
{"id":1,"value":"Tom"},
{"id":2,"value":"Jerry"},
{"id":3,"value":"Hulk"},
{"id":4,&...
0
votes
0
answers
29
views
How to reuse a loaded script in another loaded script in Jenkins without using libraries
I have a main job script,
pipline.groovy
node('Node1'){
def script1 = load('script1.groovy')
script1()
//..some code
def script2 = load('script2.groovy')
}
I load two scripts in it,
script1....
0
votes
1
answer
50
views
How to correctly incorporate GroupId in a JAR file using Gradle?
I have 2 projects, a LibraryProject and an ApplicationProject. ApplicationProject needs LibraryProject as a dependency.
In the LibraryProject, the build.gradle contains:
group = 'com.company.product'
...
0
votes
1
answer
47
views
Jmeter does not save variable with variable name <variable-name>_1
I have a loop controller in my test plan with a counter called fileNumber.
I also have a groovy script which fetches keys and uploadIds from the response of an API call. This is the script I have:
...
0
votes
0
answers
23
views
Grails 2.5.6 - "Method on class was used outside of a Grails application" error
I’m using Grails 2.5.6 and I created a simple Person domain and a PersonController.
When I try to call POST /person/add, I get the following error:
Method on class [com.demo.Person] was used outside ...
0
votes
0
answers
22
views
Jenkins Active Choice HTML parameter not updating hidden value field with dynamic JS in Groovy script
Description: I'm using the Jenkins Active Choices Plugin to build a dynamic UI with parameters for test suites and their arguments.
I have two parameters:
SUITES (Active Choice Checkbox): Lets the ...
0
votes
1
answer
80
views
Can't run 'dependencies { earlib ...' on Gradle 9.1.0
Building & deplying my EAR (JAR + WAR) on 'gradle.build' with 'gradle-wrapper.properties' runs fine on 'gradle-8.14.3':
tasks.register('ViViFYdEAR', Ear) {
project.logger.lifecycle(">&...
0
votes
0
answers
35
views
Jenkins Groovy buildRetention is deprecated
I have pipelines that I am building using groovy. Currently I am setting my buildRetention using the following:
strategy {
allBranchesSame {
props {
...
0
votes
0
answers
53
views
Run periodic job only if SVN repository has changes
I'm running Jenkins on a Windows machine, and I have a Jenkinsfile that triggers a pipeline periodically using the cron directive:
pipeline {
agent any
triggers {
cron('0 1 * * 1-5') /...
2
votes
0
answers
93
views
Cannot get Git exit code with Powershell script in Jenkins
In a Jenkins script, I do :
def status = powershell(
script: """
# Display current directory
Write-Host "Current directory: \$(Get-Location)"
# ...
0
votes
0
answers
29
views
Groovy/Grails Ambiguous mapping error with springdoc swagger
This is my controller
package example.infra.adapters.input.api.v1.endpoints
import example.aplication.services.authentication.LoginAuthenticator
import example.aplication.dtos.authentication....