Questions tagged [groovy-grape]
85 questions
1
vote
0 answers
classloader issues with hibernate and groovyConsole
I am trying the example code for using hibernate in Groovy here:
Using Hibernate with Groovy
It works fine when I run it via groovy, but when I run it with groovyConsole I am getting a classloader issue:
org.hibernate.QueryException:…

hymenopterans
- 93
- 4
1
vote
1 answer
Grape or normal import
Does it make a difference, how to integrate GPars in my projects?
Can I either do
@Grab(group='org.codehaus.gpars', module='gpars', version='1.0.0')
or just (provided I have all the required jars in my build path)
import groovyx.gpars.*
?

Evgenij Reznik
- 17,916
- 39
- 104
- 181
1
vote
1 answer
Actually installing Grape imports
I have a script that I quickly put up using a @Grab annotation to import a package - namely HttpBuilder. Now I would like to actually install HttpBuilder and get rid of the annotation before putting the script in production - I do not want to grab…

Andrea
- 20,253
- 23
- 114
- 183
0
votes
0 answers
Groovy Script: Why can't I connect slf4j as in a normal project?
The problem has been solved in this question.
I have a simple groove script:
@Grapes([
@Grab(group='io.javalin', module='javalin', version='5.6.2'),
@Grab(group='org.slf4j', module='slf4j-simple', version='2.0.7'),
…

Santa Monica
- 332
- 3
- 11
0
votes
1 answer
Dependencies in archetype-post-generation.groovy script cannot be resolved
I have some problem when creating a maven project from a maven custom archetype. I have the expected directory structure for a maven-archetype, including a post-generation groovy script, which I want to create some Kafka topics in a broker…

estarko
- 11
- 2
0
votes
0 answers
Nifi Unable to convert CSV to Excel using POI API
I want to convert csv flowfile content into XLS file usin groovy script + POI API
I m using ivy to grab POI dependencies and it seems work well.
please find more details below:
This is my Nifi flow:
This is my…

O. Sam
- 178
- 1
- 5
- 17
0
votes
1 answer
Groovy script to Grep a string from jenkins console output
I have to read the jenkins console output and grep the line which has the string "%)". I am able to grep the line wit the following code:
def result = fileContents.findAll { it.contains('%)') }
println result*.toString()
Output:
× 35 of 45 failed…

Arul
- 1
- 4
0
votes
0 answers
Groovy Dependency management
I am quite new to groovy and need to clarify on the Groovy Dependency management.
Here is the summary according to my "Homework":
Groovy Dependency management is as simple as adding an annotation to the script.…

xpt
- 20,363
- 37
- 127
- 216
0
votes
0 answers
Dependency conflict in Groovy script
Hello I created a groovy script and downloaded some dependencies using Grab.
At compile time I have the following exception thrown
Caught: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method…

jerome
- 2,029
- 4
- 38
- 58
0
votes
1 answer
JMeter Grape config for groovy on Windows?
Currently I'm trying to run groovy scripts in JMeter with grape in windows:
My JMeter has c:\JMeter\lib\groovy-all.2.4.16.jar, c:\JMeter\lib\ivy-2.5.0.jar (heard needed this).
A lot of examples I see for grape config are in Linux. I put the…

userOLG
- 3
- 1
0
votes
1 answer
Use Grab to Download Ivy Dependency Jar when Artifact name is not the same as Module name
Within a Jenkins groovy script I'm trying to download a dependency using the following:
@Grab(group='myorg', module='SuiteCreator', version='1.16.1', conf='jar', transitive=false)
import myorg.myorgAPI
I have a /home/jenkins/.groovy/grapeConfig.xml…

ptha
- 836
- 1
- 8
- 22
0
votes
0 answers
Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.2!commons-logging.jar]
I am started to learn groovy. I like to use httpbuilder. I found out that I should use @Grab so I wrote this example
// https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
@Grapes(
@Grab(group='org.apache.httpcomponents',…

Siavoshkc
- 346
- 2
- 16
0
votes
0 answers
Which Jersey version runs in Jenkins 2.107.1?
We are running a Jenkins on Ubuntu.
When we try to use a Java library in a Pipeline that uses REST calls, we run into problems. UriBuilder is apparently used in a old version: The method toTemplate is missing and caused a MethodNotFound. This is…

J Fabian Meier
- 33,516
- 10
- 64
- 142
0
votes
1 answer
Jenkins DSL ClassNotFoundException
Consider the following snippet that pulls in snakeyaml and then just loops round some basic yaml.
@Grab('org.yaml:snakeyaml:1.17')
import org.yaml.snakeyaml.Yaml
List example = new Yaml().load("- \"wibble\"\n- \"wobble\"")
example.each{ println it…

Steve Stevens
- 355
- 4
- 15
0
votes
0 answers
Class.forName fails in groovysh where dependency successfully loaded with Grape.grab
I load the kafka-clients dependency with Grape and can instantiate a StringSerializer, but Class.forName fails. Why is this happening?
$ groovysh
Groovy Shell (1.8.6, JVM:…

Travis Well
- 947
- 10
- 32