1

I am finishing a Java library that I want to make available to third parties. In addition to its core functionality, I am providing some classes that ease the usage of my library when used as part of an Eclipse plugin. Then, I have some dependencies in my library to certain OSGi/Eclipse classes (e.g., org.osgi.framework.Bundle, org.eclipse.core.runtime.FileLocator, org.eclipse.jdt.core.dom.CompilationUnit, among others).

So my questions is: What is the correct/convenient way to package this library for third parties usage?. Should I include all the Eclipse jars that contain the required dependencies ?. Intuitively, I think this is not a good solution given that the user obviously could have a different Eclipse version than the one I have, and this could lead to class loading conflicts. The solution of just not providing the Eclipse jars - and asking the user to find the ones he/she likes - does not really convince me neither.

I do not have lots of experience with Maven, but as far as I understand I can create a POM file that the user can use for downloading the last version of my project and its dependencies. But again: in that case I also have to decide if I should include or not the Eclipse jars in the download, considering the reasons I wrote above.

Thanks for sharing your experience on this regard.

4

1 回答 1

1

安装和更新在 Eclipse 中使用名为p2的供应平台进行管理。

最方便的方法是创建一个功能来打包您的插件/库,并使用功能导出向导创建可以安装您的功能的 p2 元数据存储库。P2 将处理依赖关系。

于 2011-12-11T19:19:21.433 回答