Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61261

Ivy ClassNotFoundException when using Grab


      We are getting the below exception when we try to initialize and configure Jenkins plugins through post build Groovy Script under init.groovy.d. We understood this is the issue with classloader not able to find ivy in its path. However, this is working with 2.176.2 and started breaking from 2.176.3.

      import java.util.logging.Logger
      import org.codehaus.groovy.control.CompilerConfiguration
      import org.yaml.snakeyaml.Yaml
      java.lang.ClassNotFoundException: org.apache.ivy.core.settings.IvySettings at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:565) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) Caused: java.lang.NoClassDefFoundError: org/apache/ivy/core/settings/IvySettings
      We performed various work around to resolve this and none of them were successful
      Job-DSL or Event Listener plugin cannot used since this is a config script which execute before Jenkins plugin installation/configuration. Similarly none of the pipeline utilities steps can be used at this point.
      Cannot copy Ivy.jar to $Jenkins_Home/war/WEB_INF/lib due to the fact we run Jenkins as a docker container and war path will be only exposed after docker run which eventually invokes init.groovy.d script.
      Tried adding the jar through classloader.

            Unassigned Unassigned
            gowthamsig Gowtham Subramanian
            1 Vote for this issue
            3 Start watching this issue