English 中文(简体)
• 如何为阿帕奇·帕西拉(POI)建造一个行之有效的非洲顾问团。
原标题:How to create a working OSGI bundle for Apache POI 3.8?
最佳回答
问题回答

我不知道3.8,但为3.7创建OSGi bundle非常容易地获得。 Bnd

-classpath: poi-3.7-20101029.jar, 
  poi-ooxml-3.7-20101029.jar,
  poi-ooxml-schemas-3.7-20101029.jar, 
  poi-scratchpad-3.7-20101029.jar
Bundle-Name: Apache POI
Bundle-SymbolicName: org.apache.poi
Bundle-Version: 3.7.0
Bundle-ClassPath: .
Private-Package: *
Export-Package: org.apache.poi.*;-split-package:=merge-first
Import-Package: !org.openxmlformats.schemas*, 
  !schemasMicrosoftComOfficePowerpoint*, 
  !schemasMicrosoftComOfficeWord*, 
  junit*;resolution:=optional, 
  org.apache.commons.logging;resolution:=optional, 
  *
Include-Resource: @poi-3.7-20101029.jar, 
  @poi-ooxml-3.7-20101029.jar, 
  @poi-ooxml-schemas-3.7-20101029.jar, 
  @poi-scratchpad-3.7-20101029.jar

如果你有兴趣了解同国家扫盲局合作的做法,你可以看看这一项目,提供一张om子和一张 file子(由Jarek回答):

https://github.com/evandor/skysail-bundled-libraries/tree/master/skysail.bundles.poi”rel=“nofollow”>https://github.com/evandor/skysail-bundled-libraries/tree/master/skysail.bundles.poi

Running "mvn install" gives you an "OSGi-flavored" POI jar, which can be found as well here:

https://oss.sonatype.org/content/groups/public/de/twentyeleven/skysail/org.apache.poi-osgi/3.8/

You might have to play a bit with the bnd file to make it create the exact OSGi bundle you need (maybe you don t need all the dependencies, or you want to mark them as optional).

You will find all the documentation needed on the bnd homepage. I recommend starting with this page if you haven t used this great tool before.





相关问题
OSGi - How mature is this technology?

I have a requirement where I need to share some web resources (jsp, html, js, images, css etc.) across different Spring based Struts 2 applications. And seems like OSGi can be used to achieve this? ...

OSGi unit testing without step that packages bundles

I have checked a few testing solution for OSGI including PAX and had a quick look at the abstract TestCase within Spring DM but they both appear to require one to jar up and bundle associated bundles. ...

Is there a way to secure access to bundles in OSGi?

I have an application consisting of several OSGi bundles. I would like to enforce that some of them only provide other bundles access to their services if a valid token (e. g. a license key) has been ...

• 如何限制方案资源+JV/OSGi的权利?

我想建立一个网站,让人们能够解决方案拟定任务,并最终上载解决办法(无论用哪一种证书-语言),以便核实并与其他人分享。

When to use ServiceTracker vs ServiceReference

I am just starting with OSGi programming and have come across two ways to listener for services being activated. The first way, from an EclipseRCP book, uses ServiceReference: String filter="(...

osgi-like framework without the import/export restrictions?

I like OSGi, but the import/export restrictions and the lack of context class loader creates havoc when trying to use 3rd party libraries (e.g., some libraries try to find file.xml in META-INF, ...

热门标签