无法启动在 apache karaf 中使用 maven 原型创建的包

unable to start the bundle created using maven archetype in apache karaf

我尝试使用 apache karaf 创建一个 osgi 包,使用 maven 原型,如 karaf devlopers 指南中所述。

mvn archetype:generate \-DarchetypeGroupId=org.apache.karaf.archetypes \-DarchetypeArtifactId=karaf-bundle-archetype \-DarchetypeVersion=4.0.0 \-DgroupId=com.mycompany \-DartifactId=TestBundle \-Dversion=1.0.0-SNAPSHOT \-Dpackage=com.mycompany.newpkg

所以我创建了一个 TestBundle 目录,然后我在 "mvn install" 此处创建了一个目录。所以包(jar 文件)是在目标文件夹中创建的。当我在部署时复制此文件夹时,我看到它已安装,但在重新启动时我在下面看到这个问题

karaf@victoria>bundle:list | grep Test
396 | Installed   |  80 | 1.0.0.SNAPSHOT               | TestBundle Bundle
karaf@victoria>bundle:info 396

TestBundle Bundle (396)
-----------------------
karaf@victoria>bundle:restart 396
Error executing command: Error restarting bundles:
Unable to start bundle 396: The bundle "TestBundle_1.0.0.SNAPSHOT [396]"
    could not be resolved. Reason: Missing Constraint:
        Import-Package: org.osgi.framework; version="[1.8.0,2.0.0)"

我的 pom.xml 导入包只有一颗星。 *

Manifest-Version: 1.0
Bnd-LastModified: 1446200540685
Build-Jdk: 1.8.0_51
Bundle-Activator: com.mycompany.newpkg.Activator
Bundle-Description: TestBundle OSGi bundle project.
Bundle-ManifestVersion: 2
Bundle-Name: TestBundle Bundle
Bundle-SymbolicName: TestBundle
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: com.mycompany.newpkg;version="1.0.0.SNAPSHOT";uses:="org
 .osgi.framework"
Import-Package: org.osgi.framework;version="[1.8,2)"
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
Tool: Bnd-2.4.1.201501161923

清单表明该包是针对(并期望在运行时)OSGi Core R6 框架(框架版本 1.8)编译的。您使用的 Karaf 版本是否支持 OSGi Core R6?