如何使用maven bundle插件在OSGi包中包含一个依赖jar?

我有一个OSGi兼容的包(jar),我想在其中添加一个依赖的jar。 我要添加的依赖是数据库驱动程序。 我正在使用的Karaf容器的lib文件夹中没有该jar,并且无法手动将其添加到那里。 我只能访问deploy文件夹,在那里我可以部署我的bundle。 我正在使用maven bundle插件来打包我的包。 所以,我想知道是否有办法在我的包中添加依赖jar。 目前,我通过在7zip中打开包并通过在jar中复制它来添加jar来手动将jar添加到包中,并且它工作正常。 我尝试使用标签,但在这之后,捆绑包没有被部署。 有什么办法吗?

以下是我想要在包中添加的pom.xml中的依赖项:

   com.h2database h2 1.3.158  

以下是pom.xml的build标记:

  install   org.apache.felix maven-bundle-plugin true    com.ct.service.userService.*, org.h2.*   *, org.codehaus.jackson.jaxrs  h2      

我尝试部署它时收到以下错误:

 ERROR: Bundle com.ge.dsp.userService [205] Error starting file:D:Karaf/deploy/userService-0.0.1-SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle com.ge.dsp.userService [205]: Unable to resolve 205.2: missing requirement [205.2] osgi.wiring.package; (osgi.wiring.package=org.apache.lucene.analysis)) org.osgi.framework.BundleException: Unresolved constraint in bundle com.ct.service.userService [205]: Unable to resolve 205.2: missing requirement [205.2] osgi.wiring.package; (osgi.wiring.package=org.apache.lucene.analysis) at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826) at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295) at java.lang.Thread.run(Thread.java:662) 

似乎我需要将h2-1.3.158.jar与我的bundle一起部署,并在pom.xml添加一些编辑,如下所示:

  install   org.apache.felix maven-bundle-plugin true    com.ct.service.userService.*,    *, org.codehaus.jackson.jaxrs, org.h2