I'm trying for the first time to use a worker with...
# dependency-management
I'm trying for the first time to use a worker with classloader isolation. Of course I immediately hit a `NoClassDefFoundError`:
Copy code
java.lang.NoClassDefFoundError: io/netty/channel/group/ChannelMatchers
        at io.netty.channel.group.DefaultChannelGroup.close(DefaultChannelGroup.java:221)
it's unclear how this could happen because
is not only present in the same jar but also the same package as the class that can't be found. My current best guess is that it has something to do with the fact that
is accessed via a static member? Like so:
Copy code
public ChannelGroupFuture close() {
    return close(ChannelMatchers.all()); // NoClassDefFoundError
and it does appear as if there may be another version of this class on a classpath. I can see for example that my IDE has indexed two separate versions of this
dependency (4.1.34.Final and 4.1.68.Final). So maybe the JVM can't find the class because another version of it has already been loaded by a related classloader? What's the relationship between the worker's (so-called "isolated") classloader and other classloaders? There are like 10 in the chain.
interesting, the build no longer fails when I use
yay, days without classpath pollution: 0
that's curious. I just printed out
in a simple plugin that I have. the top-level classloader has is no differences between
, containing what I set in the spec
and my plugin, and the parents of each are identical (up to re-ordering), containing just Gradle and its dependencies.
this is a more complex project, but I was also surprised at the number of classloaders involved