After playing with Intellij IDEA plugins for a while, I have noticed that plugins with external dependencies work fine, even if these dependencies are not bundled with the plugin itself nor are they publicly declared anywhere.
Picking a random example: the GenerateToString plugin depends, among other things, on log4j. But if you take a look inside the jar file, you will see that it contains only its own classes plus some resources (images and html files) and metadata (the obligatory plugin.xml and the MANIFEST.MF), none of which has any reference to log4j. And that jar file is the only thing you need to install the plugin.
How is that possible? How does IDEA manage these dependencies, so that it doesn't throw a ClassNotFoundException
or something like that in runtime?
IDEA uses custom classloader, if it doesn't find the required class in the plugin distribution, it's searched in all the jars located in IDEA_HOME/lib
directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With