Plugin dependency causes linkage error
Hi, so I am developing a plugin A that depends on another plugin. I have added it like this:
intellij {
plugins.set(listOf("com.google.idea.bazel.ijwb:${bazelVersion}") + properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
}
This "com.google.idea.bazel.ijwb:${bazelVersion}" is also an optional dependency for my plugin. Now this one has a dependency on com.google.guava and some of my compile time dependencies also have the same dependency but of different version.
In my plugin code, when I try to use an API of the above plugin, it throws a linkage error saying the class has been loaded, this happens because the "Bazel" plugin's classloader is a parent for my classloader and it has already loaded the guava dependency.
The only solution i can think of is to exclude guava transitive dependency from my build.gradle.
Is there any other better way of going around this?
Post is closed for comments.