Closed gabor523 closed 5 years ago
Which script are you having an issue with?
If you change: groovy.json.internal.LazyMap to 'Map' on line 49, does that fix it?
Unfortunately it doesn't solve this problem. :(
So given that the top-level issue mentions ivy, there may be an issue with the grape resolver. You can try these things: 1.) What version of groovy are you using? (Check this with groovy --version. I am currently testing against 2.4.7) 2.) What does your ~/.groovy/grapeConfig.xml say? 3.) have you tried clearing the ~/.groovy/grapes and ~/.m2/repository caches and pulling it again?
I didn't find ~/.groovy/grapeConfig.xml I have only ~/.groovy/grapes and ~/.m2/settings.xml Is it possible problem? But I found other things in Jenkins' configuration:
If you don't have a grapeConfig it just means you're using the default which is fine. And no m2 repo is also fine (its just a cache)
Reading this more, this error seems to be a result of the system not being able to find the ivy library grape uses for the grab statement to work. This should be in the lib directory of your groovy installation. Is it present?
You might want to try executing the script manually on the box to confirm it isn't something else about the jenkins context.
I don't know where I can find this lib directory of your groovy installation. Can you say any suggestions about this? If I check syntax for this script on the box in the Jenkins config then it will show same error as in execution. javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport
We don't install groovy. Groovy should be pre-installed on the jenkins build machine. There should be a GROOVY_HOME variable there should also be something in your path about groovy.
What is the situation if GROOVY_HOME variable doesn't exist in section of "Environment Variables" in Jenkins' job? But other groovy script execute on this Jenkins without problem.
This is a common Jenkins issue: basically it supports @Grape but does not put it's ivy dependency on the classpath. Meaning: you will get 'java.lang.NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport' if you want to use @Grape/@Grape. The only exception is the ’Job DSL’ plugin :-)
Solutions:
( see: https://groups.google.com/forum/#!topic/jenkinsci-issues/wMdNET2L3TU see also: https://issues.jenkins-ci.org/browse/JENKINS-16361 and https://issues.jenkins-ci.org/browse/JENKINS-18349 and https://issues.jenkins-ci.org/browse/JENKINS-18400)
aqlCleanup.groovy
is deprecated. Closing this as no longer relevant.
Hi,
I wanted to try this groovy script on my Jenkins but I got this error. Error: java.lang.NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2531) at java.lang.Class.getDeclaredMethods(Class.java:1855) at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:84) at java.security.AccessController.doPrivileged(Native Method) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
Do you have any idea what the problem is here? Or missing something in Jenkins?
Thanks and Regards, Gabor