Questions tagged [groovy-3.0]
8 questions
3
votes
2 answers
How to use groovy-maven-plugin with groovy 3.0.x?
As per groovy-maven-plugin documentation it is possible to specify a particular groovy version to be used in a maven build. This succeeds with groovy-all versions up to 2.4.9, but version 2.5.0 or higher will break the build with the followin…

Zaphod Beeblebrox
- 400
- 5
- 13
3
votes
1 answer
Groovy 3 and Jenkins Embedded Scripting?
I've just started playing around with Jenkins - and I'm looking at Pipelines.
I'm looking to brush-up on my Groovy skills to facilitate this.
The latest literature is all "Groovy 3" based and comes with some significant new features, but despite…

Phil
- 592
- 6
- 15
1
vote
0 answers
MissingMethodException when adding String.metaClass.call then using it on String literal
I'm trying to make String/GString objects callable with something like
String.metaClass.call = { println toUpperCase() + " " + it() }
This is producing a MissingMethodException when called on literals, though not always:
def a = 'abc'
a{ 2 * 3 } …

ernest_k
- 44,416
- 5
- 53
- 99
1
vote
0 answers
Groovy 3 and use of underscore with JsonBuilder
I have the following code that works with Groovy 2.5.7:
import groovy.json.JsonBuilder
def name = "foo"
def builder = new JsonBuilder()
builder {
_id name
contactInformation {
telephoneNumber("12345")
…

Bob
- 11
- 1
1
vote
2 answers
Write a literal YAML field using Groovy 3.0's new YamlBuilder
Groovy 3.0 has a new YamlBuilder class that works in a similar way to the existing JsonBuilder class.
I'm trying to work out if I can use YamlBuilder to generate a literal field in YAML such as:
data: |
this is
a literal
text value
My first…

SteveD
- 5,396
- 24
- 33
0
votes
0 answers
Gradle 7 (Groovy 3) - method in a closure executed/called immediately
I am updating Gradle from 5.6.3 to 7.5.1. I have a gradle custom plugin that accepts a closure. And in my main application's builg.gradle I am calling that custom plugin's task and assigning value to that closure.
main project -
task(type:…

MKB
- 7,587
- 9
- 45
- 71
0
votes
1 answer
Groovy 3 - ASTTransformation annotation segregated
I want that my custom annotation must be used in conjunction with Immutable annotation. I achieved this by the following code -
Annotation class -
@Retention(RetentionPolicy.SOURCE)
@Target([ElementType.TYPE])
@GroovyASTTransformationClass(classes =…

MKB
- 7,587
- 9
- 45
- 71
0
votes
1 answer
Gradle 7.4.2 fails on Groovy and Java 17
we're currently having a project, using
stsc@linex014:~/IdeaProjects/gradle-app$ ./gradlew -v
------------------------------------------------------------
Gradle 6.4.1
------------------------------------------------------------
Build time: …

kniffte
- 153
- 1
- 2
- 7