30,369 questions
0
votes
0
answers
50
views
Grails 3.3.10 to 4.0.4 validation problem
I have an old project in grails 3.3.10 and try to migrate to 4.0.4 (step by step, finally to 7)
I have problem with cmds
Caused by: groovy.lang.MissingMethodException: No signature of method: xxx....
0
votes
0
answers
75
views
How to create an atomic unabortable step in jenkins
I have a Jenkins pipeline with a critical stage that runs my custom .NET CLI performing important tasks. I want this stage to be fully atomic, meaning that if someone tries to abort the build while ...
Advice
1
vote
1
replies
21
views
How do Groovy (Jenkins pipeline) singletons work?
Say I have the following classes.
@Singleton
class EnvMgr {
private String environment = "default"
String getEnvironment() {
return environment
}
def setEnvironment(...
0
votes
0
answers
21
views
Jenkins Groovy list user login with Groovy script
I am Rajeswari
In the groovy script i have to filter who login in Jenkins but
I am able to filter the user list all in the manage/security Realm the user list So
How to use it
they is no direct method ...
0
votes
0
answers
45
views
Call GORM's .list() in trait with generic type
In my Grails 6 project, I'd like to add an additional feature to select domain classes, so I defined a custom trait.
trait MyDomainClassTrait<D> implements GormEntity<D> {}
// domain ...
2
votes
1
answer
67
views
How to escape 'properties' in JsonSlurper in Groovy 5?
In Groovy 4.x it was possible to escape the 'properties' keyword when using JsonSlurper using getAt('properties') like below:
import groovy.json.JsonSlurper
def json = new JsonSlurper().parseText(&...
0
votes
0
answers
53
views
TypeChecked extension for JetBrains GDSL files
I'm using JetBrains GDSL files which are a way to define extra methods and properties that are available at runtime to a Groovy script. My use case is for Jenkins pipeline steps but the GDSL ...
0
votes
1
answer
58
views
How to reuse method in loaded script from main script in Jenkins without using libraries
I have a main Groovy file with defined methods, and I've loaded a second Groovy script.
main-script.groovy
node('Node1'){
Method1()
Method2()
def loadedSecondScript = load('./second-...
0
votes
0
answers
88
views
How can I keep track of expired time in a timeout{} step?
Say I have this recursive function in a Jenkins pipeline. It's initially called by another function, but then calls itself recursively.
def recursiveFunction(final Integer timeout) {
static Integer ...
0
votes
1
answer
29
views
How to use Groovy's Map Coercion on a class without a default constructor?
We use Groovy/JUnit to test our Java Spring Boot application. We use Map coercion to define our mocks. I'd like to return a mocked ConfigurableApplicationContext when our main method calls new ...
0
votes
1
answer
68
views
Break & continue nested loops
I have learned that for "break"-ing any loop I use return true and for "continue"-ing it I use return false.Also I learned that "break"-ing each there is no way and for &...
1
vote
1
answer
59
views
unable to find class for annotation @Field in jenkins pipeline script from scm
I'm encountering an issue with my pipeline script when running it from SCM. The @Field annotation isn't being recognized, even though I'm using the correct import statement (import groovy.transform....
0
votes
1
answer
57
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
3
answers
41
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
44
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 ...