Apache ServiceMix安装捆绑OSGI



我在尝试将捆绑包安装到apacheServiceMix:时收到了此消息

执行命令时出错:安装捆绑包时出错:无法启动捆绑包mvn:org.apache.karaf.shell/shell-sample/1.0-SNAPSHOT:未解决的问题束中训练外壳样本[235]:无法解析235.0:缺少需求[235.0]osgi.ee;(&(osgi.ee=JavaSE)(版本=1.8))

这是我的命令:

osgi:install -s mvn:org.apache.karaf.shell/shell-sample/1.0-SNAPSHOT

我不明白,谷歌不能给我答案

这是我的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.karaf.shell</groupId>
  <artifactId>shell-sample</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>bundle</packaging>
  <name>shell-sample</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.servicemix.specs</groupId>
        <artifactId>org.apache.servicemix.specs.jsr311-api-1.1.1</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.servicemix.specs</groupId>
        <artifactId>org.apache.servicemix.specs.jaxb-api-2.2</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.servicemix.bundles</groupId>
        <artifactId>org.apache.servicemix.bundles.commons-httpclient</artifactId>
        <version>3.1_7</version>
    </dependency>
  </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <target>1.8</target>
                    <source>1.8</source>
                </configuration>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Description>${project.description}</Bundle-Description>
                        <Import-Package>
                            javax.wsdl,
                            javax.xml.bind,
                            javax.xml.bind.annotation,
                            javax.ws.rs,
                            javax.ws.rs.core,
                            org.springframework.beans.factory.config,
                            org.apache.commons.httpclient,
                            org.apache.commons.httpclient.methods
                        </Import-Package>
                        <Export-Package>
                            org.apache.karaf.shell.cxf.jaxrs
                        </Export-Package>
                    </instructions>
                    <target>1.8</target>
                    <source>1.8</source>
                </configuration>
            <version>2.5.3</version>
            <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.3.2</version>
                <configuration>
                    <mainClass>org.apache.karaf.shell.Service</mainClass>
                    <includePluginDependencies>false</includePluginDependencies>
                    <target>1.8</target>
                    <source>1.8</source>
                </configuration>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
</project>

我试图将java版本更改为1.5、1.6、1.7,但与其他java SE版本仍然存在相同的错误

我正在使用Eclipse Luna Java EE

osgi.ee需求是在maven捆绑插件2.5.0中引入的。因此,最简单的方法是降级到捆绑插件2.4。

要更改需求中引用的java语言版本,您必须使用maven编译器插件,并在那里设置目标和源参数。您不能在maven bundle插件配置中更改java版本。

最新更新