0

我正在做一个需要插件系统的项目。

到目前为止,我已经创建了自己的类加载器,并且能够动态加载我创建的外部 jar。(它们都实现了相同的接口。

现在,这些插件本身需要外部库。不幸的是,当我在构建主应用程序时包含所需的库时,这似乎才有效。然后我的插件也可以工作。否则,当不将库添加到主程序时,当我尝试实例化插件时,我会得到 classNotFoundExceptions。

我想要做的是在我发布它们时在插件 jar 中包含所需的库。

所以我有两个问题:

 - is it even possible to access those libs referenced by the plugins when they are   included there or do I have to manually load them too
 - if it is possible to include them, how do I extract them into the plugin jar? (just like when building a runnable jar)

在此先感谢您的帮助。

4

0 回答 0