NoClassDefFoundError for Indirect Dependency

(Mark Maxey) #1

I’m trying to write a plugin that standardizes some specific defaults for the artifactory plugin for a large team of developers.

The source code is located at I’m able to publish the plugin to Artifactory using the repositories that come out of the box. When running it using “gradle -b usesCustomPlugin.gradle”, get the error found in debug.log:

14:25:06.009 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NoClassDefFoundError: org/jfrog/build/client/ArtifactoryClientConfiguration

This class is in build-info-client-2.0.4.jar, is located in the same repository as the top level dependency (build-info-extractor-gradle), and is referenced indirectly as shown below in the extract of when I do a “gradle -I init.gradle dependencies”:

compile - Classpath for compiling the main sources.
\--- org.jfrog.buildinfo:build-info-extractor-gradle:2.0.7 [default]
     +--- commons-io:commons-io:2.0.1 [compile,master,runtime]
     +--- org.apache.ivy:ivy:2.2.0 [compile,master,runtime]
     +--- commons-logging:commons-logging:1.1.1 [compile,master,runtime]
     +--- javax.annotation:jsr250-api:1.0 [compile,master,runtime]
     +--- commons-lang:commons-lang:2.4 [compile,master,runtime]
     \--- org.jfrog.buildinfo:build-info-extractor:2.0.4 [compile,master,runtime]
          +--- commons-io:commons-io:2.0.1 [compile,master,runtime] (*)
          +--- commons-logging:commons-logging:1.1.1 [compile,master,runtime] (*)
          +--- commons-lang:commons-lang:2.4 [compile,master,runtime] (*)
          +--- [compile,master,runtime]
          +--- org.jfrog.buildinfo:build-info-client:2.0.4 [compile,master,runtime]

It is obvious that the runtime execution of the plugin doesn’t have the right JARs. It seems like it should by following the transitive dependencies.

I really don’t know how to debug this. Does anyone have any ideas?