在服务组合上创建捆绑包错误

时间:2018-03-09 11:07:02

标签: java maven spring-boot osgi bundle

我正在尝试将我的spring boot应用程序打包为一个捆绑包,以便在服务组合中使用它。

<modelVersion>4.0.0</modelVersion>

<groupId>com.myorg.cxf</groupId>
<artifactId>cxf-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>bundle</packaging>

<name>cxf-demo</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.6.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
        <version>3.1.11</version>
    </dependency>

    <dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
        <version>3.8.11</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.bundlerepository</artifactId>
        <version>2.0.4</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.4.0</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-SymbolicName>GisAdapter</Bundle-SymbolicName>
                    <Private-Package>com.myorg.cxf.cxfdemo*</Private-Package>
                    <Import-Package>*</Import-Package>
                    <Bundle-Activator>com.myorg.cxf.cxfdemo.CxfDemoApplication</Bundle-Activator>
                </instructions>
            </configuration>
        </plugin>
    </plugins>
</build>

这是我的pom。我在service mix的deploy文件夹中添加了我创建的JAR(bundle)。当我尝试启动创建的Bundle时,它给我一个错误,如缺少

apache.cxf,org.apache.cxf.jaxws,

org.springframework.beans.factory.annotation,org.springframework.boot,

org.springframework.boot.autoconfigure,org.springframework.context,
                        org.springframework.context.annotation,
                        com.fasterxml.jackson.*,
                        com.fasterxml.jackson.databind,
                        com.fasterxml.jackson.databind.annotation,
                        com.fasterxml.jackson.annotation,
                        com.fasterxml.jackson.core.*,
                        groovy.lang,
                        javax.ejb,
                        javax.validation,
                        javax.*,
                        org.apache.catalina.mbeans,
                        org.apache.catalina.*,
                        org.apache.coyote,
                        org.apache.*,
                        com.sun.msv.grammar,
                        com.sun.msv.grammar.xmlschema,
                        com.sun.msv.reader,
                        com.sun.msv.reader.xmlschema -->

这是一些错误:

Error executing command: Error executing command on bundles:
    Error starting bundle 238: Unable to resolve 
 missing requirement ]wiring.package; 
(osgi.wiring.package=org.springframework.boot) Unresolved requirements:  
osgi.wirinage; (osgi.wiring.package=org.springframework.boot)]

我试图在pom中添加该错误,例如&#34; Export-Package&#34;它会删除错误,但是请回答上面列表中缺少的其他内容等等。

0 个答案:

没有答案