简体   繁体   English

如何使用较小的JAR导出Eclipse RCP产品

[英]How to export a eclipse RCP product with smaller JARs

I am working on an Eclipse RCP project with Luna and the exported product works well. 我正在与Luna一起进行Eclipse RCP项目,并且导出的产品效果很好。 The only problem is that the generated main JAR file is too large(over 30MB). 唯一的问题是,生成的主JAR文件太大(超过30MB)。 I checked the root of this large size. 我检查了这个大号的根。 Some third-party libs, which are all put inside a folder named lib under my project, are also included into this JAR. 此JAR中还包含一些第三方库,这些库都放在我的项目下名为lib的文件夹中。 I also tried to exclude these libs in binary build and then of course the exported product did not work. 我还尝试在二进制构建中排除这些库,然后导出的产品当然不起作用。

I am wondering if there is a way to separate those third-party libs from the main JAR file and the exported product can still use them. 我想知道是否有办法将那些第三方库与主JAR文件分开,并且导出的产品仍然可以使用它们。 Thank you very much! 非常感谢你!

Consider using plug in projects to achieve this. 考虑使用插件项目来实现此目的。

Probably you will have to create a seperate plugin for the third party libraries and add that as dependency to your plug in. 可能您将不得不为第三方库创建一个单独的插件,并将其作为依赖项添加到您的插件中。

Most of the time, this is treated as a best practice as you must keep your code away from other libraries or jars. 在大多数情况下,这被视为最佳实践,因为您必须使代码远离其他库或jar。

You may also try to bring a logical grouping by creating "n" number of plug ins for your third party libraries, so that not all the third party lib you use will be kept in the same jar and maintenance will be easy. 您也可以尝试通过为第三方库创建“ n”个插件来进行逻辑分组,以便并非将您使用的所有第三方库都保存在同一jar中,并且维护起来很容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM