.. I have an application (.war) in which there is a plug-in system where each plug-in is a .jar with its .jar dependencies. And in webapp, through the admin web interface, plugins are loaded using ClassLoader, which “loads” .jar and its dependencies. But the problem is that, for example, 2 plugins A and B can have one or more common dependencies (commons-io.jar, commons-collection.jar, ...) ... so usually I should not download more, than once .jar that were already loaded by another plugin or which were already present in the web store itself → WEB-INF / lib / So, I would like to know if there is a way not to load another time .jar that has already been loaded via webapp or another plugin If possible, how should I do it!
Actually, no matter what solution is available, I just want to avoid problems with the bootloader.
NOTE: each plugin is a .zip file that has the following architecture
plugin name /
- code/ - A.class - B.class - ... - lib/ - commons-io.jar - log4j.jar - .... - description.xml - version.txt
every .class file in the / directory is loaded by the class loader, every .jar in the lib / directory of the plugin is also loaded.
But, as a rule, I should not reload the classes present in the .jar "commons-io.jar" if it has ever been present ...
I hope I was clear enough in advance for your attention and help.
source share